Version twiddling

This commit is contained in:
rocky 2021-10-21 16:33:09 -04:00
parent 3e5f963c64
commit 29a91fc015
3 changed files with 18 additions and 13 deletions

View File

@ -20,4 +20,4 @@ cd $fulldir/..
(cd ../python-xdis && git checkout master && pyenv local $PYTHON_VERSION) && git pull && \ (cd ../python-xdis && git checkout master && pyenv local $PYTHON_VERSION) && git pull && \
git checkout master && pyenv local $PYTHON_VERSION && git pull git checkout master && pyenv local $PYTHON_VERSION && git pull
cd $owd cd $owd
rm -v */.python-version || true rm -v */.python-version >/dev/null 2>&1 || true

View 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

View File

@ -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 xdis import iscode, code_has_star_arg, code_has_star_star_arg, CO_GENERATOR
from uncompyle6.scanner import Code from uncompyle6.scanner import Code
from uncompyle6.parsers.treenode import SyntaxTree from uncompyle6.parsers.treenode import SyntaxTree
from uncompyle6 import PYTHON3
from uncompyle6.semantics.parser_error import ParserError from uncompyle6.semantics.parser_error import ParserError
from uncompyle6.parser import ParserError as ParserError2 from uncompyle6.parser import ParserError as ParserError2
from uncompyle6.semantics.helper import ( from uncompyle6.semantics.helper import (
@ -29,11 +28,6 @@ from uncompyle6.semantics.helper import (
find_none, 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 from uncompyle6.show import maybe_show_tree_param_default
# FIXME: DRY the below code... # FIXME: DRY the below code...
@ -90,12 +84,9 @@ def make_function3_annotate(
# positional args are before kwargs # positional args are before kwargs
defparams = node[: args_node.attr[0]] defparams = node[: args_node.attr[0]]
pos_args, kw_args, annotate_argc = args_node.attr pos_args, kw_args, annotate_argc = args_node.attr
if "return" in annotate_args.keys():
annotate_argc = len(annotate_args) - 1
else: else:
defparams = node[: args_node.attr] defparams = node[: args_node.attr]
kw_args = 0 kw_args = 0
annotate_argc = 0
pass pass
annotate_dict = {} annotate_dict = {}
@ -104,9 +95,9 @@ def make_function3_annotate(
n = self.traverse(annotate_args[name], indent="") n = self.traverse(annotate_args[name], indent="")
annotate_dict[name] = n annotate_dict[name] = n
if 3.0 <= self.version <= 3.2: if (3, 0) <= self.version < (3, 3):
lambda_index = -2 lambda_index = -2
elif 3.03 <= self.version: elif self.version < (3, 4):
lambda_index = -3 lambda_index = -3
else: else:
lambda_index = None lambda_index = None
@ -142,7 +133,6 @@ def make_function3_annotate(
self.ERROR = p self.ERROR = p
return return
kw_pairs = args_node.attr[1]
indent = self.indent indent = self.indent
if is_lambda: if is_lambda: