Merge changes ...

* str() in Python 2.4 doesn't detect unicode.
* index() doesn't work on tuples
* ifelse change
This commit is contained in:
rocky
2017-01-11 19:34:28 -05:00
parent 89429339fa
commit fab4ebb768
4 changed files with 8 additions and 4 deletions

View File

@@ -747,7 +747,8 @@ class Python3Parser(PythonParser):
elif lhs == 'annotate_tuple':
return not isinstance(tokens[first].attr, tuple)
elif lhs == 'kwarg':
return not isinstance(tokens[first].attr, str)
return not (isinstance(tokens[first].attr, unicode) or
isinstance(tokens[first].attr, str))
elif lhs == 'while1elsestmt':
# if SETUP_LOOP target spans the else part, then this is
# not while1else. Also do for whileTrue?

View File

@@ -224,7 +224,10 @@ class Scanner(object):
for given opcode <op>.
"""
if op < self.opc.HAVE_ARGUMENT:
return 2 if self.version >= 3.6 else 1
if self.version >= 3.6:
return 2
else:
return 1
else:
if self.version >= 3.6:
return 2

View File

@@ -149,7 +149,7 @@ def make_function3_annotate(self, node, isLambda, nested=1,
self.write(suffix, param)
suffix = ', '
if param in annotate_tuple[0].attr:
p = annotate_tuple[0].attr.index(param)
p = [x for x in annotate_tuple[0].attr].index(param)
self.write(': ')
self.preorder(node[p])
if (line_number != self.line_number):

View File

@@ -1,3 +1,3 @@
# This file is suitable for sourcing inside bash as
# well as importing into Python
VERSION='2.9.9'
VERSION='2.10.0'