summaryrefslogtreecommitdiffstats
path: root/Lib/mhlib.py
diff options
context:
space:
mode:
authorRaymond Hettinger <python@rcn.com>2004-12-31 19:15:26 (GMT)
committerRaymond Hettinger <python@rcn.com>2004-12-31 19:15:26 (GMT)
commita617271dbd150549b021a5161d009869ad62f7b2 (patch)
tree764221870afed35cab4c4bc8e07d31964a794fc4 /Lib/mhlib.py
parent54266fce8db4c303a2c5ae84ecd0db493b400625 (diff)
downloadcpython-a617271dbd150549b021a5161d009869ad62f7b2.zip
cpython-a617271dbd150549b021a5161d009869ad62f7b2.tar.gz
cpython-a617271dbd150549b021a5161d009869ad62f7b2.tar.bz2
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 0a8c444..1086121 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()