Minor patches

This commit is contained in:
Miroslav Stampar
2018-08-30 15:50:17 +02:00
parent 366a3f9336
commit 62a3618353
4 changed files with 6 additions and 5 deletions

View File

@@ -48,6 +48,7 @@ def get_page(get=None, url=None, host=None, data=None):
except Exception, ex:
code = getattr(ex, "code", None)
page = ex.read() if hasattr(ex, "read") else getattr(ex, "msg", "")
headers = ex.info() if hasattr(ex, "info") else {}
result = CACHE[key] = page, headers, code