diff options
author | Raymond Hettinger <python@rcn.com> | 2004-12-31 19:15:26 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-12-31 19:15:26 (GMT) |
commit | a617271dbd150549b021a5161d009869ad62f7b2 (patch) | |
tree | 764221870afed35cab4c4bc8e07d31964a794fc4 /Lib/urlparse.py | |
parent | 54266fce8db4c303a2c5ae84ecd0db493b400625 (diff) | |
download | cpython-a617271dbd150549b021a5161d009869ad62f7b2.zip cpython-a617271dbd150549b021a5161d009869ad62f7b2.tar.gz cpython-a617271dbd150549b021a5161d009869ad62f7b2.tar.bz2 |
Use cStringIO where available.
Diffstat (limited to 'Lib/urlparse.py')
-rw-r--r-- | Lib/urlparse.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/urlparse.py b/Lib/urlparse.py index 37dd362..9c76272 100644 --- a/Lib/urlparse.py +++ b/Lib/urlparse.py @@ -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 |