You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
Start Python3 execption handling
This commit is contained in:
@@ -314,7 +314,6 @@ TABLE_DIRECT = {
|
||||
'tryelsestmtl': ( '%|try:\n%+%c%-%c%|else:\n%+%c%-', 1, 3, 4 ),
|
||||
'tf_trystmt': ( '%c%-%c%+', 1, 3 ),
|
||||
'tf_tryelsestmt': ( '%c%-%c%|else:\n%+%c', 1, 3, 4 ),
|
||||
'except': ( '%|except:\n%+%c%-', 3 ),
|
||||
'except_cond1': ( '%|except %c:\n', 1 ),
|
||||
'except_cond2': ( '%|except %c as %c:\n', 1, 5 ),
|
||||
'except_suite': ( '%+%c%-%C', 0, (1, maxint, '') ),
|
||||
@@ -490,6 +489,14 @@ class Walker(GenericASTTraversal, object):
|
||||
self.currentclass = None
|
||||
self.pending_newlines = 0
|
||||
|
||||
if version >= 3.0:
|
||||
# Python 3 adds a POP_EXCEPT instruction
|
||||
TABLE_DIRECT['except'] = ('%|except:\n%+%c%-', 4 )
|
||||
else:
|
||||
TABLE_DIRECT['except'] = ('%|except:\n%+%c%-', 3 )
|
||||
pass
|
||||
return
|
||||
|
||||
f = property(lambda s: s.params['f'],
|
||||
lambda s, x: s.params.__setitem__('f', x),
|
||||
lambda s: s.params.__delitem__('f'),
|
||||
@@ -1184,6 +1191,9 @@ class Walker(GenericASTTraversal, object):
|
||||
# self.print_("-----")
|
||||
# self.print(startnode)
|
||||
|
||||
# from trepan.api import debug
|
||||
# debug(start_opts={'startup-profile': True})
|
||||
|
||||
fmt = entry[0]
|
||||
arg = 1
|
||||
i = 0
|
||||
|
Reference in New Issue
Block a user