Fix improper 3.0 class handling...

... is like 3.1 not 2.7
This commit is contained in:
rocky
2018-04-12 17:59:39 -04:00
parent 8734608929
commit edbab038ca
5 changed files with 8 additions and 2 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -25,3 +25,7 @@ class MyClass(object):
pass
x = MyClass()
# Try class without parens
class Feature:
pass

View File

@@ -32,6 +32,8 @@ def customize_for_version3(self, version):
'store_locals': ( '%|# inspect.currentframe().f_locals = __locals__\n', ),
})
assert version >= 3.0
if version >= 3.3:
def n_yield_from(node):
self.write('yield from')

View File

@@ -1234,7 +1234,7 @@ class SourceWalker(GenericASTTraversal, object):
# -----------
# * subclass_code - the code for the subclass body
subclass_info = None
if self.version > 3.0:
if self.version >= 3.0:
if node == 'classdefdeco2':
if self.version >= 3.6:
class_name = node[1][1].pattr
@@ -1349,7 +1349,7 @@ class SourceWalker(GenericASTTraversal, object):
self.currentclass = str(class_name)
self.write(self.indent, 'class ', self.currentclass)
if self.version > 3.0:
if self.version >= 3.0:
self.print_super_classes3(subclass_info)
else:
self.print_super_classes(build_list)