diff options
author | Raymond Hettinger <python@rcn.com> | 2004-12-31 19:15:26 +0000 |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2004-12-31 19:15:26 +0000 |
commit | 29f9f307681081e4d1eedc507157bd3bc22c709a (patch) | |
tree | f2958e1eb083f58f93ee60048673495333783c5a /Lib/mhlib.py | |
parent | 50a653c43c606f26d53282e8a1233ed0fb047b65 (diff) | |
download | cpython-29f9f307681081e4d1eedc507157bd3bc22c709a.tar.gz |
Use cStringIO where available.
Diffstat (limited to 'Lib/mhlib.py')
-rw-r--r-- | Lib/mhlib.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Lib/mhlib.py b/Lib/mhlib.py index 0a8c444f2c..1086121584 100644 --- a/Lib/mhlib.py +++ b/Lib/mhlib.py @@ -697,7 +697,10 @@ class Message(mimetools.Message): encoding = self.getencoding() if not decode or encoding in ('', '7bit', '8bit', 'binary'): return self.fp.read() - from StringIO import StringIO + try: + from cStringIO import StringIO + except ImportError: + from StringIO import StringIO output = StringIO() mimetools.decode(self.fp, output, encoding) return output.getvalue() |