diff options
author | Vladimir Vukicevic <vladimir@pobox.com> | 2016-08-12 16:53:35 -0400 |
---|---|---|
committer | Vladimir Vukicevic <vladimir@pobox.com> | 2016-08-17 09:51:38 -0400 |
commit | e7dd579ebf14317e284f4f9641e4bf0b8f99022f (patch) | |
tree | cd8836e1ced0abbab486852b889f5d623c615f74 /python | |
parent | 59da96def12d7c1558cb669bc44f3b6c286d38de (diff) | |
download | servo-e7dd579ebf14317e284f4f9641e4bf0b8f99022f.tar.gz servo-e7dd579ebf14317e284f4f9641e4bf0b8f99022f.zip |
Ignore TOML failing to parse Cargo.lock, due to a bug
Diffstat (limited to 'python')
-rw-r--r-- | python/tidy/servo_tidy/tidy.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/python/tidy/servo_tidy/tidy.py b/python/tidy/servo_tidy/tidy.py index 8d989303b05..f4b893bda8c 100644 --- a/python/tidy/servo_tidy/tidy.py +++ b/python/tidy/servo_tidy/tidy.py @@ -298,8 +298,18 @@ def check_lock(file_name, contents): # package names to be neglected (as named by cargo) exceptions = ["lazy_static"] - import toml - content = toml.loads(contents) + # toml.py has a bug(?) that we trip up in [metadata] sections; + # see https://github.com/uiri/toml/issues/61 + # This should only affect a very few lines (that have embedded ?branch=...), + # and most of them won't be in the repo + try: + import toml + content = toml.loads(contents) + except: + print "WARNING!" + print "WARNING! toml parsing failed for Cargo.lock, but ignoring..." + print "WARNING!" + raise StopIteration packages = {} for package in content.get("package", []): |