]> granicus.if.org Git - python/commitdiff
Fix test_shlex: Use io.StringIO.
authorWalter Dörwald <walter@livinglogic.de>
Tue, 12 Jun 2007 17:43:43 +0000 (17:43 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Tue, 12 Jun 2007 17:43:43 +0000 (17:43 +0000)
Lib/test/test_shlex.py

index 5c6572a9ea5bc3b5acdf330eaf10be552d04ce7a..b18155e165a0cbcba726c0351ae9403f3fb7142d 100644 (file)
@@ -1,15 +1,10 @@
 # -*- coding: iso-8859-1 -*-
 import unittest
-import os, sys
+import os, sys, io
 import shlex
 
 from test import test_support
 
-try:
-    from cStringIO import StringIO
-except ImportError:
-    from StringIO import StringIO
-
 
 # The original test data set was from shellwords, by Hartmut Goebel.
 
@@ -160,7 +155,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)