]> git.phdru.name Git - bookmarks_db.git/blobdiff - Robots/bkmk_rurllib.py
Fix(Py3): Fix `.has_key()`
[bookmarks_db.git] / Robots / bkmk_rurllib.py
index 55e0037e8999e261010d095af4eb1a9b61ad9852..00a4a42b1824ce9fe37dc6cb2f9761cb65e7f3e5 100644 (file)
@@ -27,9 +27,9 @@ class RedirectException(Exception):
 class MyURLopener(urllib.URLopener):
     # Error 301 -- relocated (permanently)
     def http_error_301(self, url, fp, errcode, errmsg, headers, data=None):
-        if headers.has_key('location'):
+        if 'location' in headers:
             newurl = headers['location']
-        elif headers.has_key('uri'):
+        elif 'uri' in headers:
             newurl = headers['uri']
         else:
             newurl = "Nowhere"
@@ -49,7 +49,7 @@ class MyURLopener(urllib.URLopener):
 
     def http_error_default(self, url, fp, errcode, errmsg, headers):
         if fp:
-            void = fp.read()
+            fp.read()
             fp.close()
         raise IOError(('http error', errcode, errmsg, headers))