Ignore TOML failing to parse Cargo.lock, due to a bug

This commit is contained in:
Vladimir Vukicevic 2016-08-12 16:53:35 -04:00
parent 59da96def1
commit e7dd579ebf

View file

@ -298,8 +298,18 @@ def check_lock(file_name, contents):
# package names to be neglected (as named by cargo)
exceptions = ["lazy_static"]
# 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", []):