Fix except statement in order to be compatible with Python3

This commit is contained in:
marmeladema 2019-10-14 00:40:22 +01:00
parent f1d42fe787
commit 02cfb4f49e
2 changed files with 4 additions and 4 deletions

View file

@ -244,7 +244,7 @@ class MachCommands(CommandBase):
with open(path.join(preload_path, preload_filename), 'w') as fd:
json.dump(entries, fd, indent=4)
except ValueError, e:
except ValueError as e:
print("Unable to parse chromium HSTS preload list, has the format changed?")
sys.exit(1)

View file

@ -136,16 +136,16 @@ def download(desc, src, writer, start_byte=0):
if not dumb:
print()
except urllib.error.HTTPError, e:
except urllib.error.HTTPError as e:
print("Download failed ({}): {} - {}".format(e.code, e.reason, src))
if e.code == 403:
print("No Rust compiler binary available for this platform. "
"Please see https://github.com/servo/servo/#prerequisites")
sys.exit(1)
except urllib.error.URLError, e:
except urllib.error.URLError as e:
print("Error downloading {}: {}. The failing URL was: {}".format(desc, e.reason, src))
sys.exit(1)
except socket_error, e:
except socket_error as e:
print("Looks like there's a connectivity issue, check your Internet connection. {}".format(e))
sys.exit(1)
except KeyboardInterrupt: