You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 09:22:40 +08:00
Fixed bug in pysource / fragments where the use of deparse_code from fragments could break subsequent calls to deparse_code from pysource due to amending to the global TABLE_DIRECT.
This commit is contained in:
@@ -1526,7 +1526,7 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
self.write(fmt[i:])
|
||||
|
||||
def default(self, node):
|
||||
mapping = MAP.get(node, MAP_DIRECT)
|
||||
mapping = self._get_mapping(node)
|
||||
table = mapping[0]
|
||||
key = node
|
||||
|
||||
@@ -1861,6 +1861,11 @@ class SourceWalker(GenericASTTraversal, object):
|
||||
|
||||
return ast
|
||||
|
||||
@classmethod
|
||||
def _get_mapping(cls, node):
|
||||
return MAP.get(node, MAP_DIRECT)
|
||||
|
||||
|
||||
def deparse_code(version, co, out=sys.stdout, showasm=False, showast=False,
|
||||
showgrammar=False, code_objects={}, compile_mode='exec'):
|
||||
"""
|
||||
|
Reference in New Issue
Block a user