You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
xdis PYTHON_VERSION removal
This commit is contained in:
@@ -29,11 +29,18 @@ Step 2: Run the test:
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import getopt, os, py_compile, sys, shutil, tempfile, time
|
||||
|
||||
import getopt
|
||||
import os
|
||||
import py_compile
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
import time
|
||||
from fnmatch import fnmatch
|
||||
|
||||
from xdis.version_info import PYTHON_VERSION_TRIPLE
|
||||
|
||||
from uncompyle6.main import main
|
||||
from xdis.version_info import PYTHON_VERSION
|
||||
|
||||
|
||||
def get_srcdir():
|
||||
@@ -164,10 +171,10 @@ def do_tests(src_dir, obj_patterns, target_dir, opts):
|
||||
|
||||
if opts["do_compile"]:
|
||||
compiled_version = opts["compiled_version"]
|
||||
if compiled_version and PYTHON_VERSION != compiled_version:
|
||||
if compiled_version and PYTHON_VERSION_TRIPLE != compiled_version:
|
||||
print(
|
||||
"Not compiling: desired Python version is %s but we are running %s"
|
||||
% (compiled_version, PYTHON_VERSION),
|
||||
% (compiled_version, PYTHON_VERSION_TRIPLE),
|
||||
file=sys.stderr,
|
||||
)
|
||||
else:
|
||||
|
@@ -3,7 +3,7 @@
|
||||
# More could be done here though.
|
||||
|
||||
from math import copysign
|
||||
from xdis.version_info import PYTHON_VERSION
|
||||
from xdis.version_info import PYTHON_VERSION_TRIPLE
|
||||
|
||||
|
||||
def is_negative_zero(n):
|
||||
@@ -36,7 +36,7 @@ def better_repr(v, version):
|
||||
if len(v) == 1:
|
||||
return "(%s,)" % better_repr(v[0], version)
|
||||
return "(%s)" % ", ".join(better_repr(i, version) for i in v)
|
||||
elif PYTHON_VERSION < 3.0 and isinstance(v, long):
|
||||
elif PYTHON_VERSION_TRIPLE < (3, 0) and isinstance(v, long):
|
||||
s = repr(v)
|
||||
if version >= 3.0 and s[-1] == "L":
|
||||
return s[:-1]
|
||||
|
Reference in New Issue
Block a user