Bugfix to ESR's code reported by himself: should use hasattr() to test
for presence unread, not getattr()!
This commit is contained in:
parent
65b7863efc
commit
5430b432e6
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue