You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-03 00:45:53 +08:00
Show return value when not None...
And fixup setup.py
This commit is contained in:
63
setup.py
63
setup.py
@@ -1,6 +1,65 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
"""Setup script for the 'uncompyle6' distribution."""
|
"""Setup script for the 'uncompyle6' distribution."""
|
||||||
|
import sys
|
||||||
|
|
||||||
from setuptools import setup
|
import setuptools
|
||||||
|
|
||||||
setup(packages=["uncompyle6"])
|
SYS_VERSION = sys.version_info[0:2]
|
||||||
|
if not ((3, 6) <= SYS_VERSION < (3, 11)):
|
||||||
|
mess = "Python Release 3.6 .. 3.10 are supported in this code branch."
|
||||||
|
if (2, 4) <= SYS_VERSION <= (2, 7):
|
||||||
|
mess += (
|
||||||
|
"\nFor your Python, version %s, use the python-2.4 code/branch."
|
||||||
|
% sys.version[0:3]
|
||||||
|
)
|
||||||
|
elif SYS_VERSION >= (3, 10):
|
||||||
|
mess += (
|
||||||
|
"\nFor your Python, version %s, use the master code/branch."
|
||||||
|
% sys.version[0:3]
|
||||||
|
)
|
||||||
|
elif (3, 0) >= SYS_VERSION < (3, 3):
|
||||||
|
mess += (
|
||||||
|
"\nFor your Python, version %s, use the python-3.0-to-3.2 code/branch."
|
||||||
|
% sys.version[0:3]
|
||||||
|
)
|
||||||
|
elif SYS_VERSION < (2, 4):
|
||||||
|
mess += (
|
||||||
|
"\nThis package is not supported for Python version %s." % sys.version[0:3]
|
||||||
|
)
|
||||||
|
print(mess)
|
||||||
|
raise Exception(mess)
|
||||||
|
|
||||||
|
from __pkginfo__ import (
|
||||||
|
__version__,
|
||||||
|
author,
|
||||||
|
author_email,
|
||||||
|
classifiers,
|
||||||
|
entry_points,
|
||||||
|
install_requires,
|
||||||
|
license,
|
||||||
|
long_description,
|
||||||
|
modname,
|
||||||
|
py_modules,
|
||||||
|
short_desc,
|
||||||
|
web,
|
||||||
|
zip_safe,
|
||||||
|
)
|
||||||
|
|
||||||
|
setuptools.setup(
|
||||||
|
author=author,
|
||||||
|
author_email=author_email,
|
||||||
|
classifiers=classifiers,
|
||||||
|
description=short_desc,
|
||||||
|
entry_points=entry_points,
|
||||||
|
install_requires=install_requires,
|
||||||
|
license=license,
|
||||||
|
long_description=long_description,
|
||||||
|
long_description_content_type="text/x-rst",
|
||||||
|
name=modname,
|
||||||
|
packages=setuptools.find_packages(),
|
||||||
|
py_modules=py_modules,
|
||||||
|
test_suite="nose.collector",
|
||||||
|
url=web,
|
||||||
|
version=__version__,
|
||||||
|
zip_safe=zip_safe,
|
||||||
|
)
|
||||||
|
@@ -1212,6 +1212,7 @@ class SourceWalker(GenericASTTraversal, NonterminalActions, ComprehensionMixin):
|
|||||||
is_lambda=False,
|
is_lambda=False,
|
||||||
noneInNames=False,
|
noneInNames=False,
|
||||||
is_top_level_module=False,
|
is_top_level_module=False,
|
||||||
|
compile_mode="exec"
|
||||||
) -> GenericASTTraversal:
|
) -> GenericASTTraversal:
|
||||||
# FIXME: DRY with fragments.py
|
# FIXME: DRY with fragments.py
|
||||||
|
|
||||||
@@ -1262,7 +1263,6 @@ class SourceWalker(GenericASTTraversal, NonterminalActions, ComprehensionMixin):
|
|||||||
load_const.kind == "LOAD_CONST"
|
load_const.kind == "LOAD_CONST"
|
||||||
and load_const.linestart is None
|
and load_const.linestart is None
|
||||||
and load_const.attr is None
|
and load_const.attr is None
|
||||||
or is_top_level_module
|
|
||||||
):
|
):
|
||||||
# Delete LOAD_CONST (None) RETURN_VALUE
|
# Delete LOAD_CONST (None) RETURN_VALUE
|
||||||
del tokens[-2:]
|
del tokens[-2:]
|
||||||
@@ -1371,6 +1371,7 @@ def code_deparse(
|
|||||||
co,
|
co,
|
||||||
is_lambda=is_lambda_mode(compile_mode),
|
is_lambda=is_lambda_mode(compile_mode),
|
||||||
is_top_level_module=is_top_level_module,
|
is_top_level_module=is_top_level_module,
|
||||||
|
compile_mode=compile_mode,
|
||||||
)
|
)
|
||||||
|
|
||||||
# XXX workaround for profiling
|
# XXX workaround for profiling
|
||||||
|
Reference in New Issue
Block a user