Handle verify syntax errors...

Update README.rst stats
This commit is contained in:
rocky
2016-11-13 18:55:23 -05:00
parent ee6dddd25a
commit b6e53205dd
2 changed files with 9 additions and 4 deletions

View File

@@ -395,7 +395,10 @@ def compare_code_with_srcfile(pyc_filename, src_filename, weak_verify=False):
msg = ("Can't compare code - Python is running with magic %s, but code is magic %s "
% (PYTHON_MAGIC_INT, magic_int))
return msg
code_obj2 = load_file(src_filename)
try:
code_obj2 = load_file(src_filename)
except SyntaxError as e:
return str(e)
cmp_code_objects(version, is_pypy, code_obj1, code_obj2, ignore_code=weak_verify)
return None