From 9c2a8559164b2360a4234c59cc567b20afe29af6 Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Fri, 14 Dec 2012 19:14:58 +0100 Subject: Fix some error catching in the archives downloader --- kittystore/scripts.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kittystore/scripts.py b/kittystore/scripts.py index 0a21792..33bfc73 100644 --- a/kittystore/scripts.py +++ b/kittystore/scripts.py @@ -108,11 +108,11 @@ def _archive_downloader(args): with open(filepath, "w") as f: f.write(request.read()) except urllib2.URLError, e: - if e.code == 404: + if isinstance(e, urllib2.HTTPError) and e.code == 404: print ("This archive hasn't been created on the server yet: " + basename) else: - print e + print "Error: %s" % e.reason return pos = str(MONTHS.index(month) + 1).rjust(2, "0") newname = '{0}-{1}-{2}-{3}.txt'.format(opts.list_name, year, pos, month) -- cgit