diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2014-01-22 01:08:48 +0200 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2014-01-22 01:08:48 +0200 |
commit | bb8f9f5fa4f4d442ef41825ea6e16d8549d82342 (patch) | |
tree | aca08b48b3d2299b3be1d0ecafa8694634af1c50 /rebuilder.py | |
parent | 0016a643646b05dec44837caef95cb3f9135ccec (diff) | |
download | astroid-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.py | 12 |
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 |