]> granicus.if.org Git - python/commitdiff
_structure(): Make sure all output goes the to fp object.
authorBarry Warsaw <barry@python.org>
Thu, 13 May 2004 20:14:20 +0000 (20:14 +0000)
committerBarry Warsaw <barry@python.org>
Thu, 13 May 2004 20:14:20 +0000 (20:14 +0000)
Lib/email/Iterators.py

index 2572c205be8c2d97739ab149c73b7557bedb93dd..af6095e7c76785544a7990a65989edda57ef7aaf 100644 (file)
@@ -59,9 +59,9 @@ def _structure(msg, fp=None, level=0, include_default=False):
     tab = ' ' * (level * 4)
     print >> fp, tab + msg.get_content_type(),
     if include_default:
-        print '[%s]' % msg.get_default_type()
+        print >> fp, '[%s]' % msg.get_default_type()
     else:
-        print
+        print >> fp
     if msg.is_multipart():
         for subpart in msg.get_payload():
             _structure(subpart, fp, level+1, include_default)