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, \

View File

@@ -1,11 +1,11 @@
import sys
from uncompyle6 import PYTHON3
from uncompyle6.scanner import get_scanner
from uncompyle6.semantics.consts import (
escape, NONE,
# RETURN_NONE, PASS, RETURN_LOCALS
)
from xdis.version_info import PYTHON3
if PYTHON3:
from io import StringIO
def iteritems(d):

View File

@@ -1,9 +1,10 @@
import pytest
from uncompyle6 import PYTHON_VERSION, code_deparse
pytestmark = pytest.mark.skip(PYTHON_VERSION < 2.7,
from uncompyle6 import code_deparse
from xdis.version_info import PYTHON_VERSION_TRIPLE
pytestmark = pytest.mark.skip(PYTHON_VERSION_TRIPLE < (2, 7),
reason="need at least Python 2.7")
if PYTHON_VERSION > 2.6:
if PYTHON_VERSION_TRIPLE > (2, 6):
def test_single_mode():
single_expressions = (
'i = 1',