3.6 constant tuples in call

This commit is contained in:
rocky
2019-04-30 16:25:48 -04:00
parent c074107504
commit 03d23328eb
3 changed files with 11 additions and 2 deletions

Binary file not shown.

View File

@@ -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)

View File

@@ -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(', ')