summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1998-06-22 15:46:26 (GMT)
committerGuido van Rossum <guido@python.org>1998-06-22 15:46:26 (GMT)
commit5430b432e6a40c45b790afb2e21668d8164342a6 (patch)
treec94148e02b744d5f44e043f5f179874a2971523b /Lib
parent65b7863efc55a284bb16d4c4a25f774dcbe21776 (diff)
downloadcpython-5430b432e6a40c45b790afb2e21668d8164342a6.zip
cpython-5430b432e6a40c45b790afb2e21668d8164342a6.tar.gz
cpython-5430b432e6a40c45b790afb2e21668d8164342a6.tar.bz2
Bugfix to ESR's code reported by himself: should use hasattr() to test
for presence unread, not getattr()!
Diffstat (limited to 'Lib')
-rw-r--r--Lib/rfc822.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/rfc822.py b/Lib/rfc822.py
index 87d7d39..fc244c5 100644
--- a/Lib/rfc822.py
+++ b/Lib/rfc822.py
@@ -160,7 +160,7 @@ class Message:
else:
self.status = 'Non-header line where header expected'
# Try to undo the read.
- if getattr(self.fp, 'unread'):
+ if hasattr(self.fp, 'unread'):
self.fp.unread(line)
elif self.seekable:
self.fp.seek(-len(line), 1)