mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Implement the suggestion of bug_id=122070: surround tell() call with
try/except.
This commit is contained in:
parent
17bfef5860
commit
a66eed62fd
1 changed files with 5 additions and 1 deletions
|
@ -132,7 +132,11 @@ class Message:
|
|||
tell = self.fp.tell
|
||||
while 1:
|
||||
if tell:
|
||||
startofline = tell()
|
||||
try:
|
||||
startofline = tell()
|
||||
except IOError:
|
||||
startofline = tell = None
|
||||
self.seekable = 0
|
||||
line = self.fp.readline()
|
||||
if not line:
|
||||
self.status = 'EOF in headers'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue