mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +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
|
tell = self.fp.tell
|
||||||
while 1:
|
while 1:
|
||||||
if tell:
|
if tell:
|
||||||
startofline = tell()
|
try:
|
||||||
|
startofline = tell()
|
||||||
|
except IOError:
|
||||||
|
startofline = tell = None
|
||||||
|
self.seekable = 0
|
||||||
line = self.fp.readline()
|
line = self.fp.readline()
|
||||||
if not line:
|
if not line:
|
||||||
self.status = 'EOF in headers'
|
self.status = 'EOF in headers'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue