diff options
-rw-r--r-- | Lib/httplib.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/httplib.py b/Lib/httplib.py index b1712d8..03adb43 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -231,6 +231,10 @@ class HTTPResponse: line = self.fp.readline() if self.debuglevel > 0: print "reply:", repr(line) + if not line: + # Presumably, the server closed the connection before + # sending a valid response. + raise BadStatusLine(line) try: [version, status, reason] = line.split(None, 2) except ValueError: |