mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
handle class exceptions
This commit is contained in:
parent
cebfa70a79
commit
c7acf2a106
4 changed files with 26 additions and 10 deletions
|
@ -30,7 +30,10 @@ def compile_dir(dir, maxlevels = 10):
|
|||
print '\n[interrupt]'
|
||||
break
|
||||
except:
|
||||
print 'Sorry:', sys.exc_type + ':',
|
||||
if type(sys.exc_type) == type(''):
|
||||
exc_type_name = sys.exc_type
|
||||
else: exc_type_name = sys.exc_type.__name__
|
||||
print 'Sorry:', exc_type_name + ':',
|
||||
print sys.exc_value
|
||||
elif maxlevels > 0 and \
|
||||
name != os.curdir and name != os.pardir and \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue