Kaydet (Commit) b7d3e65b authored tarafından Guido van Rossum's avatar Guido van Rossum

Improve error handling; don't die from unicode errors or syntax errors.

üst 8ac004e6
......@@ -67,11 +67,17 @@ def compile_dir(dir, maxlevels=10, ddir=None,
raise KeyboardInterrupt
except py_compile.PyCompileError as err:
if quiet:
print('Compiling', fullname, '...')
print('*** Error compiling', fullname, '...')
else:
print('*** ', end='')
print(err.msg)
success = 0
except IOError as e:
print("Sorry", e)
except (SyntaxError, UnicodeError, IOError) as e:
if quiet:
print('*** Error compiling', fullname, '...')
else:
print('*** ', end='')
print(e.__class__.__name__ + ':', e)
success = 0
else:
if ok == 0:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment