diff options
author | Jeff Epler <jepler@unpythonic.net> | 2018-03-25 16:13:49 -0500 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2018-05-30 11:14:07 +1000 |
commit | c60589c02b998794837489a6c6e51c4723af097f (patch) | |
tree | 574f1ef797e9a9a3acb13d0259531e60664f6c04 /tests/basics/class_super.py | |
parent | 05b13fd292b42f20affc7cae218d92447efbf6d6 (diff) |
py/objtype: Fix assertion failures in super_attr by checking type.
Fixes assertion failures and segmentation faults when making calls like:
super(1, 1).x
Diffstat (limited to 'tests/basics/class_super.py')
-rw-r--r-- | tests/basics/class_super.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/basics/class_super.py b/tests/basics/class_super.py index 698fe5dff..b6ee68308 100644 --- a/tests/basics/class_super.py +++ b/tests/basics/class_super.py @@ -35,6 +35,12 @@ class B(A): return super().foo().count(2) # calling a subsequent method print(B().foo()) +# first arg to super must be a type +try: + super(1, 1) +except TypeError: + print('TypeError') + # store/delete of super attribute not allowed assert hasattr(super(B, B()), 'foo') try: |