summaryrefslogtreecommitdiff
path: root/rebuilder.py
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2014-01-22 01:08:48 +0200
committerClaudiu Popa <pcmanticore@gmail.com>2014-01-22 01:08:48 +0200
commitbb8f9f5fa4f4d442ef41825ea6e16d8549d82342 (patch)
treeaca08b48b3d2299b3be1d0ecafa8694634af1c50 /rebuilder.py
parent0016a643646b05dec44837caef95cb3f9135ccec (diff)
downloadastroid-git-bb8f9f5fa4f4d442ef41825ea6e16d8549d82342.tar.gz
Simplify check, make sure that _newstyle is always checked for Python 3.
Diffstat (limited to 'rebuilder.py')
-rw-r--r--rebuilder.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/rebuilder.py b/rebuilder.py
index 2f6cf44d..0f1bae0e 100644
--- a/rebuilder.py
+++ b/rebuilder.py
@@ -333,12 +333,12 @@ class TreeRebuilder(object):
newnode.decorators = self.visit_decorators(node, newnode)
newnode.set_line_info(newnode.last_child())
metaclass = self._metaclass.pop()
- if not newnode.bases:
- # no base classes, detect new / style old style according to
- # current scope
- if PY3K:
- newnode._newstyle = True
- else:
+ if PY3K:
+ newnode._newstyle = True
+ else:
+ if not newnode.bases:
+ # no base classes, detect new / style old style according to
+ # current scope
newnode._newstyle = metaclass in ('type', 'ABCMeta')
newnode.parent.frame().set_local(newnode.name, newnode)
return newnode