Improve error handling; don't die from unicode errors or syntax errors.
diff --git a/Lib/compileall.py b/Lib/compileall.py
index 6781908..6300776 100644
--- a/Lib/compileall.py
+++ b/Lib/compileall.py
@@ -67,11 +67,17 @@
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: