Fix Python 3.x pringing superclasses...

class Description: not class Description("Description").
Introduced in not catching LOAD_CONST->LOAD_STR change
This commit is contained in:
rocky
2019-12-15 10:49:24 -05:00
parent 0eaeb82d48
commit e93b70bcce
5 changed files with 10 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -15,3 +15,11 @@ class BZ2File(io.BufferedIOBase):
class ABC(metaclass=BZ2File):
pass
# From 3.3 test_abc
# Bug was class Descriptor("Descriptor"): instead of below
def test_customdescriptors_with_abstractmethod():
class Descriptor:
def setter(self):
return Descriptor(self._fget)

View File

@@ -26,7 +26,7 @@ FULLVERSION=$(pyenv local)
PYVERSION=${FULLVERSION%.*}
MINOR=${FULLVERSION##?.?.}
typeset -i STOP_ONERROR=1
STOP_ONERROR=${STOP_ONERROR:-1}
typeset -A SKIP_TESTS
case $PYVERSION in

View File

@@ -1630,7 +1630,7 @@ class SourceWalker(GenericASTTraversal, object):
pass
pass
else:
if self.version >= 3.6 and node[0] == "LOAD_CONST":
if node[0] == "LOAD_STR":
return
value = self.traverse(node[0])
self.write("(")