Skip to content

Commit ecab7d7

Browse files
committed
Python 2.4 unpack rule needs adjusting for exceptions
1 parent e39a902 commit ecab7d7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

uncompyle6/semantics/pysource.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1827,9 +1827,15 @@ def n_unpack(self, node):
18271827
self.write(', ')
18281828
self.prune()
18291829
return
1830+
18301831
for n in node[1:]:
18311832
if n[0].kind == 'unpack':
18321833
n[0].kind = 'unpack_w_parens'
1834+
1835+
# In Python 2.4, unpack is used in (a, b, c) of:
1836+
# except RuntimeError, (a, b, c):
1837+
if self.version < 2.7:
1838+
node.kind = 'unpack_w_parens'
18331839
self.default(node)
18341840

18351841
n_unpack_w_parens = n_unpack

0 commit comments

Comments
 (0)