mirror of
https://github.com/servo/servo.git
synced 2025-07-24 15:50:21 +01:00
Ignore TOML failing to parse Cargo.lock, due to a bug
This commit is contained in:
parent
59da96def1
commit
e7dd579ebf
1 changed files with 12 additions and 2 deletions
|
@ -298,8 +298,18 @@ def check_lock(file_name, contents):
|
||||||
# package names to be neglected (as named by cargo)
|
# package names to be neglected (as named by cargo)
|
||||||
exceptions = ["lazy_static"]
|
exceptions = ["lazy_static"]
|
||||||
|
|
||||||
import toml
|
# toml.py has a bug(?) that we trip up in [metadata] sections;
|
||||||
content = toml.loads(contents)
|
# 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 = {}
|
packages = {}
|
||||||
for package in content.get("package", []):
|
for package in content.get("package", []):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue