diff options
author | Claudiu Popa <pcmanticore@gmail.com> | 2013-07-24 17:31:49 +0300 |
---|---|---|
committer | Claudiu Popa <pcmanticore@gmail.com> | 2013-07-24 17:31:49 +0300 |
commit | 2e7fb65c516c974a5bd3d80a9a6b9a09c3b05afd (patch) | |
tree | 1104daaf0c8041a418e396614b437093ea32b705 /scoped_nodes.py | |
parent | f2d11a2251f17479da72a71b645dd4aae7f10d65 (diff) | |
download | astroid-git-2e7fb65c516c974a5bd3d80a9a6b9a09c3b05afd.tar.gz |
Add support for metaclass for Python 3.
Diffstat (limited to 'scoped_nodes.py')
-rw-r--r-- | scoped_nodes.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/scoped_nodes.py b/scoped_nodes.py index 524e3f68..f9df97d9 100644 --- a/scoped_nodes.py +++ b/scoped_nodes.py @@ -991,9 +991,12 @@ class Class(Statement, LocalsDictNodeNG, FilterStmtsMixin): if missing: raise InferenceError() + _metaclass = None def metaclass(self): """ return the metaclass of this class """ - # TODO: handle class A(metaclass=B) for Python 3 + if self._metaclass: + return self._metaclass + try: meta = Instance(self).getattr('__metaclass__')[0] except NotFoundError: |