mirror of
https://github.com/rocky/python-uncompyle6.git
synced 2024-11-23 05:00:07 +00:00
Version twiddling
This commit is contained in:
parent
3e5f963c64
commit
29a91fc015
@ -20,4 +20,4 @@ cd $fulldir/..
|
||||
(cd ../python-xdis && git checkout master && pyenv local $PYTHON_VERSION) && git pull && \
|
||||
git checkout master && pyenv local $PYTHON_VERSION && git pull
|
||||
cd $owd
|
||||
rm -v */.python-version || true
|
||||
rm -v */.python-version >/dev/null 2>&1 || true
|
||||
|
15
admin-tools/setup-python-3.3.sh
Normal file
15
admin-tools/setup-python-3.3.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
PYTHON_VERSION=3.3.7
|
||||
pyenv local $PYTHON_VERSION
|
||||
|
||||
owd=$(pwd)
|
||||
bs=${BASH_SOURCE[0]}
|
||||
|
||||
mydir=$(dirname $bs)
|
||||
fulldir=$(readlink -f $mydir)
|
||||
cd $fulldir/..
|
||||
(cd ../python-xdis && ./admin-tools/setup-python-3.3.sh)
|
||||
cd $owd
|
||||
rm -v */.python-version || true
|
||||
|
||||
git checkout python-3.3-to-3.5 && git pull && pyenv local $PYTHON_VERSION
|
@ -19,7 +19,6 @@ The saga of changes before and after is in other files.
|
||||
from xdis import iscode, code_has_star_arg, code_has_star_star_arg, CO_GENERATOR
|
||||
from uncompyle6.scanner import Code
|
||||
from uncompyle6.parsers.treenode import SyntaxTree
|
||||
from uncompyle6 import PYTHON3
|
||||
from uncompyle6.semantics.parser_error import ParserError
|
||||
from uncompyle6.parser import ParserError as ParserError2
|
||||
from uncompyle6.semantics.helper import (
|
||||
@ -29,11 +28,6 @@ from uncompyle6.semantics.helper import (
|
||||
find_none,
|
||||
)
|
||||
|
||||
if PYTHON3:
|
||||
from itertools import zip_longest
|
||||
else:
|
||||
from itertools import izip_longest as zip_longest
|
||||
|
||||
from uncompyle6.show import maybe_show_tree_param_default
|
||||
|
||||
# FIXME: DRY the below code...
|
||||
@ -90,12 +84,9 @@ def make_function3_annotate(
|
||||
# positional args are before kwargs
|
||||
defparams = node[: args_node.attr[0]]
|
||||
pos_args, kw_args, annotate_argc = args_node.attr
|
||||
if "return" in annotate_args.keys():
|
||||
annotate_argc = len(annotate_args) - 1
|
||||
else:
|
||||
defparams = node[: args_node.attr]
|
||||
kw_args = 0
|
||||
annotate_argc = 0
|
||||
pass
|
||||
|
||||
annotate_dict = {}
|
||||
@ -104,9 +95,9 @@ def make_function3_annotate(
|
||||
n = self.traverse(annotate_args[name], indent="")
|
||||
annotate_dict[name] = n
|
||||
|
||||
if 3.0 <= self.version <= 3.2:
|
||||
if (3, 0) <= self.version < (3, 3):
|
||||
lambda_index = -2
|
||||
elif 3.03 <= self.version:
|
||||
elif self.version < (3, 4):
|
||||
lambda_index = -3
|
||||
else:
|
||||
lambda_index = None
|
||||
@ -142,7 +133,6 @@ def make_function3_annotate(
|
||||
self.ERROR = p
|
||||
return
|
||||
|
||||
kw_pairs = args_node.attr[1]
|
||||
indent = self.indent
|
||||
|
||||
if is_lambda:
|
||||
|
Loading…
Reference in New Issue
Block a user