diff options
author | Aurélien Bompard <aurelien@bompard.org> | 2012-12-14 19:14:58 +0100 |
---|---|---|
committer | Aurélien Bompard <aurelien@bompard.org> | 2012-12-14 19:14:58 +0100 |
commit | 9c2a8559164b2360a4234c59cc567b20afe29af6 (patch) | |
tree | 9a9dfaace1e882df55096f1ade9b75029825591c /kittystore | |
parent | 6a67f640f1bc4f42b116f505d741e51d1eb64680 (diff) | |
download | kittystore-9c2a8559164b2360a4234c59cc567b20afe29af6.tar.gz kittystore-9c2a8559164b2360a4234c59cc567b20afe29af6.tar.xz kittystore-9c2a8559164b2360a4234c59cc567b20afe29af6.zip |
Fix some error catching in the archives downloader
Diffstat (limited to 'kittystore')
-rw-r--r-- | kittystore/scripts.py | 4 |
1 files 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) |