sys.exit(1)
# These should only be unexpected crashes due to bugs in the code
# str(e) often doesn't contain a reason, so just show the backtrace
- except Exception, e:
+ except Exception as e:
logging.critical("Unknown exception found!")
raise
sys.exit(0)
try:
resp = urllib2.urlopen(req, None, 20)
page = resp.read()
- except urllib2.HTTPError, e:
+ except urllib2.HTTPError as e:
return (None, str(e.code))
- except Exception, e:
+ except Exception as e:
return (None, 'Failed:' + str(e))
version = None
try:
self.gotorevisionx(rev)
- except FDroidException, e:
+ except FDroidException as e:
exc = e
# If necessary, write the .fdroidvcs file.
try:
p = subprocess.Popen(commands, cwd=cwd, shell=False, env=env,
stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
- except OSError, e:
+ except OSError as e:
raise BuildException("OSError while trying to execute " +
' '.join(commands) + ': ' + str(e))
for appid, app in apps.iteritems():
try:
description_html(app.Description, linkres)
- except MetaDataException, e:
+ except MetaDataException as e:
raise MetaDataException("Problem with description of " + appid +
" - " + str(e))
iconpath, oldsize, im.size))
im.save(iconpath, "PNG")
- except Exception, e:
+ except Exception as e:
logging.error("Failed resizing {0} - {1}".format(iconpath, e))
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)
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']:
logging.info("...successfully verified")
verified += 1
- except FDroidException, e:
+ except FDroidException as e:
logging.info("...NOT verified - {0}".format(e))
notverified += 1