You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Fix bug in 2.6- except_cond3
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
# From 2.6.9 ConfigParser.py
|
||||
# Note this can only be compiled in Python 2.x
|
||||
#
|
||||
# Note: this can only be compiled in Python 2.x
|
||||
# Note also name "except_as" is a little bit of
|
||||
# a misnomer since this is 2.7+ lingo for
|
||||
# 2.6- syntax which we use here.
|
||||
|
||||
# Bug was being able to handle:
|
||||
# except KeyError, e
|
||||
# vs 2.6+.
|
||||
@@ -17,9 +20,12 @@
|
||||
|
||||
try:
|
||||
value = "foo"
|
||||
except RuntimeError:
|
||||
|
||||
# Test ensuring parens around (a, b, c) in
|
||||
# except_cond2 or except_cond3
|
||||
except RuntimeError, (a, b, c):
|
||||
# Test:
|
||||
# raise_stmt3 ::= expr expr expr RAISE_VARARGS_3
|
||||
raise 1, 2, 3
|
||||
raise a, b, c
|
||||
except KeyError, e:
|
||||
raise RuntimeError('foo')
|
||||
|
@@ -12,10 +12,8 @@ typeset -A SKIP_TESTS
|
||||
case $PYVERSION in
|
||||
2.4)
|
||||
SKIP_TESTS=( [test_binop.py]=1 # need to fix tryelse
|
||||
[test_bool.py]=1 # need to fix tryelse
|
||||
[test_call.py]=1 # need to fix tryelse
|
||||
[test_cgi.py]=1 # need to fix tryelse
|
||||
[test_class.py]=1 # need to fix tryelse
|
||||
[test_codecs.py]=1 # need to fix tryelse
|
||||
[test_dis.py]=1 # We change line numbers - duh!
|
||||
)
|
||||
;;
|
||||
|
@@ -353,6 +353,7 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
'testtrue_then': ( 'not %p', (0, 22) ),
|
||||
|
||||
})
|
||||
|
||||
if 2.4 <= version <= 2.6:
|
||||
TABLE_DIRECT.update({
|
||||
'comp_for': ( ' for %c in %c', 3, 1 ),
|
||||
@@ -1901,6 +1902,10 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
node[-2][0].kind = 'unpack_w_parens'
|
||||
self.default(node)
|
||||
|
||||
# except_cond3 is only in Python <= 2.6
|
||||
n_except_cond3 = n_except_cond2
|
||||
|
||||
|
||||
def template_engine(self, entry, startnode):
|
||||
"""The format template interpetation engine. See the comment at the
|
||||
beginning of this module for the how we interpret format
|
||||
|
Reference in New Issue
Block a user