From 03d23328eb386f597001d157093850364045b28c Mon Sep 17 00:00:00 2001 From: rocky Date: Tue, 30 Apr 2019 16:25:48 -0400 Subject: [PATCH] 3.6 constant tuples in call --- test/bytecode_3.6/03_build_tuple_call.pyc | Bin 0 -> 303 bytes test/simple_source/bug36/03_build_tuple_call.py | 4 ++++ uncompyle6/semantics/customize36.py | 9 +++++++-- 3 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 test/bytecode_3.6/03_build_tuple_call.pyc create mode 100644 test/simple_source/bug36/03_build_tuple_call.py diff --git a/test/bytecode_3.6/03_build_tuple_call.pyc b/test/bytecode_3.6/03_build_tuple_call.pyc new file mode 100644 index 0000000000000000000000000000000000000000..665332136bf8e82c219c99e96c3f88f44925334f GIT binary patch literal 303 zcmYjM!Ab)$5S_{HwneR9;18?^D=c^t@eAs~+aiQ?CzjM~yCfS#*rR8!-n@J9;8*w! zx%v@;Cnu#82j0u@lJ{m(O{WJxA76K$0PxM&m*DQ2;g6UI2%n(_61Pxh4YHIfW8{n* zhCg8%U?`JR?6g(Arn-=1d{>Xm+M2a4(WS@|>tm^iWE*U6 zI_3H@i@DeKKIY0TeH0Im@8Al4`g`h4+gUCBCb&k=7GYUk%+4#h2*#4^L%M5}wP)Q^ mJWQFp$!TSu{s!pA%yXWd&TZ;H8nG59m+gjv)mK{=EAR(7zeZvJ literal 0 HcmV?d00001 diff --git a/test/simple_source/bug36/03_build_tuple_call.py b/test/simple_source/bug36/03_build_tuple_call.py new file mode 100644 index 00000000..3ceb990c --- /dev/null +++ b/test/simple_source/bug36/03_build_tuple_call.py @@ -0,0 +1,4 @@ +# From Python 3.6.5 email/message.py +# Bug is in handling 'related' parameter +def add_related(self, *args, **kw): + self._add_multipart('related', *args, _disp='inline', **kw) diff --git a/uncompyle6/semantics/customize36.py b/uncompyle6/semantics/customize36.py index 6c2a547b..5b283ad1 100644 --- a/uncompyle6/semantics/customize36.py +++ b/uncompyle6/semantics/customize36.py @@ -124,8 +124,13 @@ def customize_for_version36(self, version): tup = btuwc[0] if tup == 'expr': tup = tup[0] - assert tup == 'tuple' - self.call36_tuple(tup) + + if tup == 'LOAD_CONST': + self.write(', '.join(['"%s"' % t.replace('"','\\"') for t in tup.attr])) + else: + assert tup == 'tuple' + self.call36_tuple(tup) + assert node[2] == 'build_map_unpack_with_call' self.write(', ')