diff options
author | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-05-29 16:45:22 +0300 |
---|---|---|
committer | Claudiu Popa <cpopa@cloudbasesolutions.com> | 2015-05-29 16:45:22 +0300 |
commit | 08b05056af12e103c2f37569ad5091ca5fd4d787 (patch) | |
tree | b46ed0ff89c9729d3dfae3142be4e1b9138e6710 /astroid/objects.py | |
parent | 31e260549b7b848f90d571f8038005345d7fd883 (diff) | |
download | astroid-git-08b05056af12e103c2f37569ad5091ca5fd4d787.tar.gz |
Fail when calling Super.super_mro if the object-or-type is not the expected type.
Diffstat (limited to 'astroid/objects.py')
-rw-r--r-- | astroid/objects.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/astroid/objects.py b/astroid/objects.py index ac689808..5fd594df 100644 --- a/astroid/objects.py +++ b/astroid/objects.py @@ -103,7 +103,10 @@ class Super(NodeNG): self._class_based = True mro_type = self.type else: - mro_type = self.type._proxied + mro_type = getattr(self.type, '_proxied', None) + if not isinstance(mro_type, (Instance, Class)): + raise SuperError("super(type, obj): obj must be an instance " + "or subtype of type") if not mro_type.newstyle: raise SuperError("Unable to call super on old-style classes.") |