use xdis.PYTHON3 not uncompyle.PYTHON3

This commit is contained in:
rocky
2021-11-02 06:16:26 -04:00
parent b4912e7b64
commit ed34bf9d4a
17 changed files with 27 additions and 42 deletions

View File

@@ -1,6 +1,5 @@
import pytest
from uncompyle6.semantics.fragments import code_deparse as deparse, deparsed_find
from uncompyle6 import PYTHON_VERSION, PYTHON3
from uncompyle6.semantics.fragments import code_deparse as deparse
from xdis.version_info import PYTHON_VERSION, PYTHON3
def map_stmts(x, y):
x = []
@@ -37,13 +36,11 @@ def check_expect(expect, parsed, fn_name):
debug = False
i = 2
max_expect = len(expect)
code = get_parsed_for_fn(fn_name)
for name, offset in sorted(parsed.offsets.keys()):
assert i+1 <= max_expect, (
"%s: ran out if items in testing node" % fn_name)
nodeInfo = parsed.offsets[name, offset]
node = nodeInfo.node
nodeInfo2 = deparsed_find((name, offset), parsed, code)
extractInfo = parsed.extract_node_info(node)
assert expect[i] == extractInfo.selectedLine, \