Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2c849f2

Browse files
committed
Fix test_shlex: Use io.StringIO.
1 parent 26e0f51 commit 2c849f2

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

Lib/test/test_shlex.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,10 @@
11
# -*- coding: iso-8859-1 -*-
22
import unittest
3-
import os, sys
3+
import os, sys, io
44
import shlex
55

66
from test import test_support
77

8-
try:
9-
from cStringIO import StringIO
10-
except ImportError:
11-
from StringIO import StringIO
12-
138

149
# The original test data set was from shellwords, by Hartmut Goebel.
1510

@@ -160,7 +155,7 @@ def splitTest(self, data, comments):
160155

161156
def oldSplit(self, s):
162157
ret = []
163-
lex = shlex.shlex(StringIO(s))
158+
lex = shlex.shlex(io.StringIO(s))
164159
tok = lex.get_token()
165160
while tok:
166161
ret.append(tok)

0 commit comments

Comments
 (0)