You've already forked python-uncompyle6
mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2025-08-04 01:09:52 +08:00
Lint-like changes from VSCode
Also allow 3.11 to run this
This commit is contained in:
4
setup.py
4
setup.py
@@ -5,8 +5,8 @@ import sys
|
|||||||
"""Setup script for the 'uncompyle6' distribution."""
|
"""Setup script for the 'uncompyle6' distribution."""
|
||||||
|
|
||||||
SYS_VERSION = sys.version_info[0:2]
|
SYS_VERSION = sys.version_info[0:2]
|
||||||
if not ((2, 4) <= SYS_VERSION < (3, 11)):
|
if not ((2, 4) <= SYS_VERSION < (3, 12)):
|
||||||
mess = "Python Release 2.6 .. 3.10 are supported in this code branch."
|
mess = "Python Release 2.6 .. 3.11 are supported in this code branch."
|
||||||
if (2, 4) <= SYS_VERSION <= (2, 7):
|
if (2, 4) <= SYS_VERSION <= (2, 7):
|
||||||
mess += (
|
mess += (
|
||||||
"\nFor your Python, version %s, use the python-2.4 code/branch."
|
"\nFor your Python, version %s, use the python-2.4 code/branch."
|
||||||
|
@@ -133,51 +133,34 @@ import sys
|
|||||||
|
|
||||||
IS_PYPY = "__pypy__" in sys.builtin_module_names
|
IS_PYPY = "__pypy__" in sys.builtin_module_names
|
||||||
|
|
||||||
from xdis import iscode, COMPILER_FLAG_BIT
|
from spark_parser import GenericASTTraversal
|
||||||
|
from xdis import COMPILER_FLAG_BIT, iscode
|
||||||
from xdis.version_info import PYTHON_VERSION_TRIPLE
|
from xdis.version_info import PYTHON_VERSION_TRIPLE
|
||||||
|
|
||||||
|
import uncompyle6.parser as python_parser
|
||||||
from uncompyle6.parser import get_python_parser
|
from uncompyle6.parser import get_python_parser
|
||||||
from uncompyle6.parsers.treenode import SyntaxTree
|
from uncompyle6.parsers.treenode import SyntaxTree
|
||||||
from spark_parser import GenericASTTraversal
|
|
||||||
from uncompyle6.scanner import Code, get_scanner
|
from uncompyle6.scanner import Code, get_scanner
|
||||||
import uncompyle6.parser as python_parser
|
from uncompyle6.scanners.tok import Token
|
||||||
from uncompyle6.semantics.check_ast import checker
|
from uncompyle6.semantics.check_ast import checker
|
||||||
|
from uncompyle6.semantics.consts import (ASSIGN_DOC_STRING, ASSIGN_TUPLE_PARAM,
|
||||||
|
INDENT_PER_LEVEL, LINE_LENGTH, MAP,
|
||||||
|
MAP_DIRECT, NAME_MODULE, NONE, PASS,
|
||||||
|
PRECEDENCE, RETURN_LOCALS,
|
||||||
|
RETURN_NONE, TAB, TABLE_R, escape)
|
||||||
|
from uncompyle6.semantics.customize import customize_for_version
|
||||||
|
from uncompyle6.semantics.gencomp import ComprehensionMixin
|
||||||
|
from uncompyle6.semantics.helper import (
|
||||||
|
find_globals_and_nonlocals,
|
||||||
|
print_docstring
|
||||||
|
)
|
||||||
from uncompyle6.semantics.make_function1 import make_function1
|
from uncompyle6.semantics.make_function1 import make_function1
|
||||||
from uncompyle6.semantics.make_function2 import make_function2
|
from uncompyle6.semantics.make_function2 import make_function2
|
||||||
from uncompyle6.semantics.make_function3 import make_function3
|
from uncompyle6.semantics.make_function3 import make_function3
|
||||||
from uncompyle6.semantics.make_function36 import make_function36
|
from uncompyle6.semantics.make_function36 import make_function36
|
||||||
from uncompyle6.semantics.parser_error import ParserError
|
|
||||||
from uncompyle6.semantics.customize import customize_for_version
|
|
||||||
from uncompyle6.semantics.gencomp import ComprehensionMixin
|
|
||||||
from uncompyle6.semantics.helper import (
|
|
||||||
print_docstring,
|
|
||||||
find_globals_and_nonlocals,
|
|
||||||
)
|
|
||||||
|
|
||||||
from uncompyle6.scanners.tok import Token
|
|
||||||
|
|
||||||
from uncompyle6.semantics.n_actions import NonterminalActions
|
from uncompyle6.semantics.n_actions import NonterminalActions
|
||||||
from uncompyle6.semantics.transform import is_docstring, TreeTransform
|
from uncompyle6.semantics.parser_error import ParserError
|
||||||
from uncompyle6.semantics.consts import (
|
from uncompyle6.semantics.transform import TreeTransform, is_docstring
|
||||||
ASSIGN_DOC_STRING,
|
|
||||||
ASSIGN_TUPLE_PARAM,
|
|
||||||
INDENT_PER_LEVEL,
|
|
||||||
LINE_LENGTH,
|
|
||||||
MAP,
|
|
||||||
MAP_DIRECT,
|
|
||||||
NAME_MODULE,
|
|
||||||
NONE,
|
|
||||||
PASS,
|
|
||||||
PRECEDENCE,
|
|
||||||
RETURN_LOCALS,
|
|
||||||
RETURN_NONE,
|
|
||||||
TAB,
|
|
||||||
TABLE_R,
|
|
||||||
escape,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
from uncompyle6.show import maybe_show_tree
|
from uncompyle6.show import maybe_show_tree
|
||||||
from uncompyle6.util import better_repr
|
from uncompyle6.util import better_repr
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2019-2021 by Rocky Bernstein
|
# Copyright (c) 2019-2022 by Rocky Bernstein
|
||||||
|
|
||||||
# This program is free software: you can redistribute it and/or modify
|
# This program is free software: you can redistribute it and/or modify
|
||||||
# it under the terms of the GNU General Public License as published by
|
# it under the terms of the GNU General Public License as published by
|
||||||
@@ -432,7 +432,7 @@ class TreeTransform(GenericASTTraversal, object):
|
|||||||
if sstmt[0] == "ann_assign":
|
if sstmt[0] == "ann_assign":
|
||||||
sstmt[0] = ann_assign_init
|
sstmt[0] = ann_assign_init
|
||||||
else:
|
else:
|
||||||
sstmt[0][0] = ann_assing_init
|
sstmt[0][0] = ann_assign_init
|
||||||
sstmt[0].transformed_by = "n_stmts"
|
sstmt[0].transformed_by = "n_stmts"
|
||||||
pass
|
pass
|
||||||
pass
|
pass
|
||||||
|
Reference in New Issue
Block a user