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 | 94b27ec32afbce37083acf2c69256cf6ea8cb4fc (patch) | |
tree | 6ea635498dcd1b5483d3d7f4eebd2bad01701874 /astroid/objects.py | |
parent | a1832df5727d24fbdb1ce362dec64bde619ca2f0 (diff) | |
download | astroid-94b27ec32afbce37083acf2c69256cf6ea8cb4fc.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 ac68980..5fd594d 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.") |