mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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
1 changed files with 1 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue