Fix the test for retrieval error.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 1 Oct 2012 04:04:39 +0000 (00:04 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 1 Oct 2012 04:04:39 +0000 (00:04 -0400)
irkerhook.py

index 62c13d59a3af02c13416cbba5b827768538d73e3..d12dcdba4df87ec3d71b170d9ff17be0689118ce 100755 (executable)
@@ -138,8 +138,7 @@ class GenericExtractor:
             prefix = self.urlprefix % self.__dict__
             try:
                 webview = prefix + self.commit
-                txt = open(urllib.urlretrieve(webview)[0]).read()
-                if "404" in txt or "not found" in txt:
+                if urllib.urlopen(webview).getcode() == 404:
                     raise IOError
                 try:
                     # Didn't get a retrieval error or 404 on the web