summaryrefslogtreecommitdiff
path: root/Lib/mhlib.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-12-31 19:15:26 +0000
committerRaymond Hettinger <python@rcn.com>2004-12-31 19:15:26 +0000
commit29f9f307681081e4d1eedc507157bd3bc22c709a (patch)
treef2958e1eb083f58f93ee60048673495333783c5a /Lib/mhlib.py
parent50a653c43c606f26d53282e8a1233ed0fb047b65 (diff)
downloadcpython-29f9f307681081e4d1eedc507157bd3bc22c709a.tar.gz
Use cStringIO where available.
Diffstat (limited to 'Lib/mhlib.py')
-rw-r--r--Lib/mhlib.py5
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()