Commit 5430b432 authored by Guido van Rossum's avatar Guido van Rossum

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

for presence unread, not getattr()!
parent 65b7863e
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment