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
This commit is contained in:
committed by
Damien George
parent
05b13fd292
commit
c60589c02b
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user