Author: guido.van.rossum
Date: Sun Jul 15 15:01:48 2007
New Revision: 56396
Modified:
python/branches/py3k-struni/Lib/compileall.py
Log:
Improve error handling; don't die from unicode errors or syntax errors.
Modified: python/branches/py3k-struni/Lib/compileall.py
==============================================================================
--- python/branches/py3k-struni/Lib/compileall.py (original)
+++ python/branches/py3k-struni/Lib/compileall.py Sun Jul 15 15:01:48 2007
@@ -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:
_______________________________________________
Python-3000-checkins mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000-checkins