summaryrefslogtreecommitdiff
path: root/scoped_nodes.py
diff options
context:
space:
mode:
Diffstat (limited to 'scoped_nodes.py')
-rw-r--r--scoped_nodes.py5
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: