From c60589c02b998794837489a6c6e51c4723af097f Mon Sep 17 00:00:00 2001 From: Jeff Epler Date: Sun, 25 Mar 2018 16:13:49 -0500 Subject: 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 --- tests/basics/class_super.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'tests/basics') 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: -- cgit v1.2.3