Skip to content
This repository has been archived by the owner on Dec 4, 2018. It is now read-only.

Commit

Permalink
http.client.BadStatusLine, not http.BadStatusLine.
Browse files Browse the repository at this point in the history
  • Loading branch information
otsaloma committed Jul 7, 2014
1 parent 0cad7d5 commit 6936366
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Poor Maps 0.6.1
===============

[X] Retry geocoding or routing in case of http.BadStatusLine error,
which probably implies a broken connection, which seems to probably
happen when a persistent HTTP connection was made, but lost due to
the device going to sleep
[X] Retry geocoding or routing in case of http.client.BadStatusLine
error, which probably implies a broken connection, which seems
to probably happen when a persistent HTTP connection was made,
but lost due to the device going to sleep
[X] Only cache successful geocoding and routing results

Poor Maps 0.7
Expand Down
2 changes: 1 addition & 1 deletion poor/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def request_url(url, encoding=None, retry=1):
return blob.decode(encoding, errors="replace")
except Exception as error:
remove_connection(url)
if isinstance(error, http.BadStatusLine) and retry > 0:
if isinstance(error, http.client.BadStatusLine) and retry > 0:
# This probably means that the connection was broken.
return request_url(url, encoding, retry-1)
print("Failed to download data: {}"
Expand Down
2 changes: 1 addition & 1 deletion poor/tilesource.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def download(self, x, y, zoom, retry=1):
except Exception as error:
httpc.close()
httpc = self._init_http_connection()
if isinstance(error, http.BadStatusLine) and retry > 0:
if isinstance(error, http.client.BadStatusLine) and retry > 0:
# This probably means that the connection was broken.
return self.download(x, y, zoom, retry-1)
print("Failed to download tile: {}"
Expand Down

0 comments on commit 6936366

Please sign in to comment.