except named exception handling

This commit is contained in:
NeroBurner 2015-09-17 13:25:08 +02:00 committed by Daniel Martí
parent af38f151a2
commit 5ca182a20d
6 changed files with 10 additions and 10 deletions

View file

@ -331,7 +331,7 @@ def resize_icon(iconpath, density):
iconpath, oldsize, im.size))
im.save(iconpath, "PNG")
except Exception, e:
except Exception as e:
logging.error("Failed resizing {0} - {1}".format(iconpath, e))
@ -490,7 +490,7 @@ def scan_apks(apps, apkcache, repodir, knownapks):
apk['id'] = re.match(name_pat, line).group(1)
apk['versioncode'] = int(re.match(vercode_pat, line).group(1))
apk['version'] = re.match(vername_pat, line).group(1)
except Exception, e:
except Exception as e:
logging.error("Package matching failed: " + str(e))
logging.info("Line was: " + line)
sys.exit(1)
@ -615,7 +615,7 @@ def scan_apks(apps, apkcache, repodir, knownapks):
os.path.join(get_icon_dir(repodir, density), iconfilename))
empty_densities.remove(density)
break
except Exception, e:
except Exception as e:
logging.warn("Failed reading {0} - {1}".format(iconpath, e))
if apk['icons']: