Bugfix to ESR's code reported by himself: should use hasattr() to test

for presence unread, not getattr()!
This commit is contained in:
Guido van Rossum 1998-06-22 15:46:26 +00:00
parent 65b7863efc
commit 5430b432e6
1 changed files with 1 additions and 1 deletions

View File

@ -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)