mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-03-19 15:30:29 +00:00
improve BadStatusLine exception message
git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@3452 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
parent
04f89d0668
commit
229e352c0c
1 changed files with 4 additions and 4 deletions
|
|
@ -300,7 +300,7 @@ class HTTPResponse:
|
|||
if not line:
|
||||
# Presumably, the server closed the connection before
|
||||
# sending a valid response.
|
||||
raise BadStatusLine(line)
|
||||
raise BadStatusLine("Bad status line %r" % line)
|
||||
try:
|
||||
[version, status, reason] = line.split(None, 2)
|
||||
except ValueError:
|
||||
|
|
@ -314,7 +314,7 @@ class HTTPResponse:
|
|||
if not version.startswith('HTTP/'):
|
||||
if self.strict:
|
||||
self.close()
|
||||
raise BadStatusLine(line)
|
||||
raise BadStatusLine("Bad status line %r" % line)
|
||||
else:
|
||||
# assume it's a Simple-Response from an 0.9 server
|
||||
self.fp = LineAndFileWrapper(line, self.fp)
|
||||
|
|
@ -324,9 +324,9 @@ class HTTPResponse:
|
|||
try:
|
||||
status = int(status)
|
||||
if status < 100 or status > 999:
|
||||
raise BadStatusLine(line)
|
||||
raise BadStatusLine("Bad status line %r" % line)
|
||||
except ValueError:
|
||||
raise BadStatusLine(line)
|
||||
raise BadStatusLine("Bad status line %r" % line)
|
||||
return version, status, reason
|
||||
|
||||
def begin(self):
|
||||
|
|
|
|||
Loading…
Reference in a new issue