From: Eric S. Raymond Date: Mon, 1 Oct 2012 04:04:39 +0000 (-0400) Subject: Fix the test for retrieval error. X-Git-Tag: 1.3~10 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1e3524881ae11176b3cc5f114ed1613805ebb673;p=irker.git Fix the test for retrieval error. --- diff --git a/irkerhook.py b/irkerhook.py index 62c13d5..d12dcdb 100755 --- a/irkerhook.py +++ b/irkerhook.py @@ -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