summaryrefslogtreecommitdiffstats
path: root/Lib/mailbox.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-12-14 22:18:37 (GMT)
committerGuido van Rossum <guido@python.org>1999-12-14 22:18:37 (GMT)
commitcd975761846dd17718f4c55afdbc288b0d9cc534 (patch)
tree10645d993acec3c4b7b67f84d8cf32227bfd6df4 /Lib/mailbox.py
parent12c6e2d4978e4fdca8262bafeecd5e63eef23c1e (diff)
downloadcpython-cd975761846dd17718f4c55afdbc288b0d9cc534.zip
cpython-cd975761846dd17718f4c55afdbc288b0d9cc534.tar.gz
cpython-cd975761846dd17718f4c55afdbc288b0d9cc534.tar.bz2
Only set msg.fp to None when there are no extra arguments; if there
are, we must keep the file around so we can print the body.
Diffstat (limited to 'Lib/mailbox.py')
-rwxr-xr-xLib/mailbox.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/mailbox.py b/Lib/mailbox.py
index 3c758ff..108967d 100755
--- a/Lib/mailbox.py
+++ b/Lib/mailbox.py
@@ -255,7 +255,8 @@ def _test():
if msg is None:
break
msgs.append(msg)
- msg.fp = None
+ if len(args) <= 1:
+ msg.fp = None
if len(args) > 1:
num = string.atoi(args[1])
print 'Message %d body:'%num