Python3 try/except handling improvements. Add Walker exception and use

that: fixes erroneous uncompyle success message on parse error.
This commit is contained in:
rocky
2015-12-26 00:12:02 -05:00
parent 0409cee6a9
commit fe9c8d5734
7 changed files with 74 additions and 35 deletions

View File

@@ -5,23 +5,28 @@
try:
x = 1
except RuntimeError as e:
y = 2
except:
pass
# # Tests:
# # trystmt ::= SETUP_EXCEPT suite_stmts_opt POP_BLOCK
# # try_middle COME_FROM
# # except_stmt ::= except_cond1 except_suite
# # except_suite ::= ...
# Tests:
# trystmt ::= SETUP_EXCEPT suite_stmts_opt POP_BLOCK
# try_middle COME_FROM
# except_stmt ::= except_cond1 except_suite
# except_suite ::= ...
# try:
# x = 1
# except ImportError:
# pass
try:
x = 1
except ImportError:
pass
# try:
# x = 2
# except ImportError:
# x = 3
# finally:
# x = 4
try:
x = 2
except ImportError:
x = 3
finally:
x = 4
try:
x = 1
except ImportError as e:
x = 2

View File

@@ -1,6 +1,13 @@
def handle(module):
try:
module = 1
except ImportError as exc:
module = exc
return module
try:
pass
except ImportError as exc:
pass
finally:
del exc
y = 1