Resolves code review comments

* Lots of rust-isms
* Mutable iterator for modifying entries (much better)
This commit is contained in:
Sam Gibson 2015-07-18 10:04:06 +10:00
parent 8086034e0b
commit 29a34dbdb5
3 changed files with 48 additions and 66 deletions

View file

@ -218,10 +218,13 @@ class MachCommands(CommandBase):
try:
content_base64 = download_bytes("Chromium HSTS preload list", chromium_hsts_url)
except urllib2.URLError, e:
print("Unable to download chromium HSTS preload list, are you connected to the internet?")
print("Unable to download chromium HSTS preload list; are you connected to the internet?")
sys.exit(1)
content_decoded = base64.b64decode(content_base64)
# The chromium "json" has single line comments in it which, of course,
# are non-standard/non-valid json. Simply strip them out before parsing
content_json = re.sub(r'//.*$', '', content_decoded, flags=re.MULTILINE)
try: