Merge branch 'master' into python-2.4

This commit is contained in:
rocky
2020-10-31 11:37:53 -04:00
10 changed files with 29 additions and 26 deletions

View File

@@ -98,6 +98,6 @@ def read(*rnames):
return open(os.path.join(srcdir, *rnames)).read() return open(os.path.join(srcdir, *rnames)).read()
# Get info from files; set: long_description and VERSION # Get info from files; set: long_description and __version__
long_description = read("README.rst") + "\n" long_description = read("README.rst") + "\n"
exec(read("uncompyle6/version.py")) exec(read("uncompyle6/version.py"))

View File

@@ -55,11 +55,11 @@
# Make packages and tag # Make packages and tag
$ . ./admin-tools/make-dist-older.sh $ . ./admin-tools/make-dist-older.sh
$ pyenv local 3.8.4 $ pyenv local 3.8.5
$ twine check dist/uncompyle6-$VERSION*
$ ./admin-tools/make-dist-newer.sh
$ twine check dist/uncompyle6-$VERSION* $ twine check dist/uncompyle6-$VERSION*
$ git tag release-python-2.4-$VERSION $ git tag release-python-2.4-$VERSION
$ ./admin-tools/make-dist-newer.sh
$ twine check dist/uncompyle6-$VERSION*
# Check package on github # Check package on github

View File

@@ -26,7 +26,7 @@ from __pkginfo__ import (
modname, modname,
py_modules, py_modules,
short_desc, short_desc,
VERSION, __version__,
web, web,
zip_safe, zip_safe,
) )
@@ -49,6 +49,6 @@ setup(
test_suite="nose.collector", test_suite="nose.collector",
url=web, url=web,
tests_require=["nose>=1.0"], tests_require=["nose>=1.0"],
version=VERSION, version=__version__,
zip_safe=zip_safe, zip_safe=zip_safe,
) )

View File

@@ -30,10 +30,7 @@ import sys
__docformat__ = "restructuredtext" __docformat__ = "restructuredtext"
from uncompyle6.version import VERSION from uncompyle6.version import __version__
# This ensures VERSION will appear in pydoc
__version__ = VERSION
PYTHON3 = sys.version_info >= (3, 0) PYTHON3 = sys.version_info >= (3, 0)

View File

@@ -1,12 +1,12 @@
#!/usr/bin/env python #!/usr/bin/env python
# Mode: -*- python -*- # Mode: -*- python -*-
# #
# Copyright (c) 2015-2016, 2018 by Rocky Bernstein <rb@dustyfeet.com> # Copyright (c) 2015-2016, 2018, 2020 by Rocky Bernstein <rb@dustyfeet.com>
# #
import sys, os, getopt import sys, os, getopt
from uncompyle6.disas import disassemble_file from uncompyle6.disas import disassemble_file
from uncompyle6.version import VERSION from uncompyle6.version import __version__
program, ext = os.path.splitext(os.path.basename(__file__)) program, ext = os.path.splitext(os.path.basename(__file__))
@@ -57,7 +57,7 @@ Type -h for for full help.""" % program
print(__doc__) print(__doc__)
sys.exit(1) sys.exit(1)
elif opt in ('-V', '--version'): elif opt in ('-V', '--version'):
print("%s %s" % (program, VERSION)) print("%s %s" % (program, __version__))
sys.exit(0) sys.exit(0)
else: else:
print(opt) print(opt)

View File

@@ -1,7 +1,7 @@
#!/usr/bin/env python #!/usr/bin/env python
# Mode: -*- python -*- # Mode: -*- python -*-
# #
# Copyright (c) 2015-2017, 2019 by Rocky Bernstein # Copyright (c) 2015-2017, 2019-2020 by Rocky Bernstein
# Copyright (c) 2000-2002 by hartmut Goebel <h.goebel@crazy-compilers.com> # Copyright (c) 2000-2002 by hartmut Goebel <h.goebel@crazy-compilers.com>
# #
import sys, os, getopt, time import sys, os, getopt, time
@@ -62,7 +62,7 @@ program = 'uncompyle6'
from uncompyle6 import verify from uncompyle6 import verify
from uncompyle6.main import main, status_msg from uncompyle6.main import main, status_msg
from uncompyle6.version import VERSION from uncompyle6.version import __version__
def usage(): def usage():
print(__doc__) print(__doc__)
@@ -101,7 +101,7 @@ def main_bin():
print(__doc__) print(__doc__)
sys.exit(0) sys.exit(0)
elif opt in ('-V', '--version'): elif opt in ('-V', '--version'):
print("%s %s" % (program, VERSION)) print("%s %s" % (program, __version__))
sys.exit(0) sys.exit(0)
elif opt == '--verify': elif opt == '--verify':
options['do_verify'] = 'strong' options['do_verify'] = 'strong'

View File

@@ -19,7 +19,7 @@ from xdis import iscode, sysinfo2float
from uncompyle6.disas import check_object_path from uncompyle6.disas import check_object_path
from uncompyle6.semantics import pysource from uncompyle6.semantics import pysource
from uncompyle6.parser import ParserError from uncompyle6.parser import ParserError
from uncompyle6.version import VERSION from uncompyle6.version import __version__
# from uncompyle6.linenumbers import line_number_mapping # from uncompyle6.linenumbers import line_number_mapping
@@ -97,13 +97,15 @@ def decompile(
write("# -*- coding: %s -*-" % source_encoding) write("# -*- coding: %s -*-" % source_encoding)
write( write(
"# uncompyle6 version %s\n" "# uncompyle6 version %s\n"
"# %sPython bytecode %s%s\n# Decompiled from: %sPython %s" % "# %sPython bytecode %s%s\n# Decompiled from: %sPython %s"
(VERSION, % (
co_pypy_str, __version__,
bytecode_version, co_pypy_str,
" (%s)" % m, run_pypy_str, bytecode_version,
"\n# ".join(sys_version_lines), " (%s)" % str(magic_int) if magic_int else "",
) run_pypy_str,
"\n# ".join(sys_version_lines),
)
) )
if bytecode_version >= 3.0: if bytecode_version >= 3.0:
write( write(

View File

@@ -170,7 +170,6 @@ class Python35Parser(Python34Parser):
elif opname == 'BEFORE_ASYNC_WITH' and self.version < 3.8: elif opname == 'BEFORE_ASYNC_WITH' and self.version < 3.8:
# Some Python 3.5+ async additions # Some Python 3.5+ async additions
rules_str = """ rules_str = """
async_with_stmt ::= expr
stmt ::= async_with_stmt stmt ::= async_with_stmt
async_with_pre ::= BEFORE_ASYNC_WITH GET_AWAITABLE LOAD_CONST YIELD_FROM SETUP_ASYNC_WITH async_with_pre ::= BEFORE_ASYNC_WITH GET_AWAITABLE LOAD_CONST YIELD_FROM SETUP_ASYNC_WITH
async_with_post ::= COME_FROM_ASYNC_WITH async_with_post ::= COME_FROM_ASYNC_WITH

View File

@@ -13,6 +13,11 @@ except:
from uncompyle6 import PYTHON_VERSION from uncompyle6 import PYTHON_VERSION
def is_negative_zero(n):
"""Returns true if n is -0.0"""
return n == 0.0 and copysign(1, n) == -1
def better_repr(v, version): def better_repr(v, version):
"""Work around Python's unorthogonal and unhelpful repr() for primitive float """Work around Python's unorthogonal and unhelpful repr() for primitive float
and complex.""" and complex."""

View File

@@ -12,4 +12,4 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# This file is suitable for sourcing inside POSIX shell as # This file is suitable for sourcing inside POSIX shell as
# well as importing into Python # well as importing into Python
VERSION="3.7.4" # noqa __version__="3.7.4" # noqa