diff options
author | Simon Sapin <simon.sapin@exyr.org> | 2015-11-30 21:39:27 +0100 |
---|---|---|
committer | Simon Sapin <simon.sapin@exyr.org> | 2015-12-02 19:07:59 +0100 |
commit | aa1eba4f5a28cd60720271e541745545e6b0337b (patch) | |
tree | 5020e85fa5854d033532c8457cc60eafb56b0867 /python/tidy.py | |
parent | 3720e4d5ef09d710deaf846c74356ccea8d7afce (diff) | |
download | servo-aa1eba4f5a28cd60720271e541745545e6b0337b.tar.gz servo-aa1eba4f5a28cd60720271e541745545e6b0337b.zip |
Use skia and deps from crates.io.
Fix https://github.com/servo/skia/issues/70
Diffstat (limited to 'python/tidy.py')
-rw-r--r-- | python/tidy.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/python/tidy.py b/python/tidy.py index 65e59054caf..034fb91d93e 100644 --- a/python/tidy.py +++ b/python/tidy.py @@ -181,12 +181,12 @@ def check_lock(file_name, contents): packages[name] = (version, idx + 1, base_name) elif all([packages[name][0] != version, name not in exceptions, base_name not in exceptions]): line = idx + 1 - version_1 = tuple(map(int, packages[name][0].split('.'))) - version_2 = tuple(map(int, version.split('.'))) + version_1 = tuple(map(maybe_int, packages[name][0].split('.'))) + version_2 = tuple(map(maybe_int, version.split('.'))) if version_1 < version_2: # get the line & base package containing the older version packages[name], (version, line, base_name) = (version, line, base_name), packages[name] - message = 'conflicting versions for package "%s"' % name + message = 'duplicate versions for package "%s"' % name error = '\n\t\033[93mexpected maximum version "{}"\033[0m'.format(packages[name][0]) + \ '\n\t\033[91mbut, "{}" demands "{}"\033[0m' \ .format(base_name, version) @@ -198,6 +198,13 @@ def check_lock(file_name, contents): idx += 1 +def maybe_int(value): + try: + return int(value) + except ValueError: + return value + + def check_toml(file_name, contents): if not file_name.endswith(".toml"): raise StopIteration |