Skip to content

Commit a20972d

Browse files
committed
xdis PYTHON_VERSION removal
1 parent 18b5934 commit a20972d

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

test/test_pythonlib.py

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,18 @@
2929

3030
from __future__ import print_function
3131

32-
import getopt, os, py_compile, sys, shutil, tempfile, time
33-
32+
import getopt
33+
import os
34+
import py_compile
35+
import shutil
36+
import sys
37+
import tempfile
38+
import time
3439
from fnmatch import fnmatch
40+
41+
from xdis.version_info import PYTHON_VERSION_TRIPLE
42+
3543
from uncompyle6.main import main
36-
from xdis.version_info import PYTHON_VERSION
3744

3845

3946
def get_srcdir():
@@ -164,10 +171,10 @@ def file_matches(files, root, basenames, patterns):
164171

165172
if opts["do_compile"]:
166173
compiled_version = opts["compiled_version"]
167-
if compiled_version and PYTHON_VERSION != compiled_version:
174+
if compiled_version and PYTHON_VERSION_TRIPLE != compiled_version:
168175
print(
169176
"Not compiling: desired Python version is %s but we are running %s"
170-
% (compiled_version, PYTHON_VERSION),
177+
% (compiled_version, PYTHON_VERSION_TRIPLE),
171178
file=sys.stderr,
172179
)
173180
else:

uncompyle6/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# More could be done here though.
44

55
from math import copysign
6-
from xdis.version_info import PYTHON_VERSION
6+
from xdis.version_info import PYTHON_VERSION_TRIPLE
77

88

99
def is_negative_zero(n):
@@ -36,7 +36,7 @@ def better_repr(v, version):
3636
if len(v) == 1:
3737
return "(%s,)" % better_repr(v[0], version)
3838
return "(%s)" % ", ".join(better_repr(i, version) for i in v)
39-
elif PYTHON_VERSION < 3.0 and isinstance(v, long):
39+
elif PYTHON_VERSION_TRIPLE < (3, 0) and isinstance(v, long):
4040
s = repr(v)
4141
if version >= 3.0 and s[-1] == "L":
4242
return s[:-1]

0 commit comments

Comments
 (0)