From 1e3524881ae11176b3cc5f114ed1613805ebb673 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Mon, 1 Oct 2012 00:04:39 -0400 Subject: [PATCH] Fix the test for retrieval error. --- irkerhook.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 -- 2.26.2