aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Lib/test/test_shlex.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_shlex.py')
-rw-r--r--Lib/test/test_shlex.py17
1 files changed, 6 insertions, 11 deletions
diff --git a/Lib/test/test_shlex.py b/Lib/test/test_shlex.py
index 6c35f491b5b..25e4b6df6c5 100644
--- a/Lib/test/test_shlex.py
+++ b/Lib/test/test_shlex.py
@@ -1,13 +1,8 @@
-# -*- coding: iso-8859-1 -*-
import unittest
+import os, sys, io
import shlex
-from test import test_support
-
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
+from test import support
# The original test data set was from shellwords, by Hartmut Goebel.
@@ -72,7 +67,7 @@ foo\ x\x\""|foo|\|x|\|x|\|""|
foo\ bar|foo|\|bar|
foo#bar\nbaz|foobaz|
:-) ;-)|:|-|)|;|-|)|
-áéíóú|á|é|í|ó|ú|
+áéíóú|á|é|í|ó|ú|
"""
posix_data = r"""x|x|
@@ -136,7 +131,7 @@ foo\ x\x\"|foo xx"|
foo\ bar|foo bar|
foo#bar\nbaz|foo|baz|
:-) ;-)|:-)|;-)|
-áéíóú|áéíóú|
+áéíóú|áéíóú|
"""
class ShlexTest(unittest.TestCase):
@@ -159,7 +154,7 @@ class ShlexTest(unittest.TestCase):
def oldSplit(self, s):
ret = []
- lex = shlex.shlex(StringIO(s))
+ lex = shlex.shlex(io.StringIO(s))
tok = lex.get_token()
while tok:
ret.append(tok)
@@ -185,7 +180,7 @@ if not getattr(shlex, "split", None):
delattr(ShlexTest, methname)
def test_main():
- test_support.run_unittest(ShlexTest)
+ support.run_unittest(ShlexTest)
if __name__ == "__main__":
test_main()