Use cStringIO where available.

This commit is contained in:
Raymond Hettinger 2004-12-31 19:15:26 +00:00
parent 54266fce8d
commit a617271dbd
8 changed files with 55 additions and 19 deletions

View file

@ -243,8 +243,11 @@ def test():
else:
fp = open(fn)
else:
import StringIO
fp = StringIO.StringIO(test_input)
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
fp = StringIO(test_input)
while 1:
line = fp.readline()
if not line: break