mirror of
https://github.com/micropython/micropython.git
synced 2025-09-05 17:30:41 +02:00
This fixes various null dereferencing and out-of-bounds access because super_attr assumes the held obj is effectively an object of the held type, which is now verified. Fixes issue #12830. Signed-off-by: stijn <stijn@ignitron.net>
16 lines
242 B
Python
16 lines
242 B
Python
# Check that super rejects invalid arguments.
|
|
try:
|
|
super(str, 0)
|
|
except TypeError:
|
|
print("TypeError")
|
|
|
|
try:
|
|
super(str, int)
|
|
except TypeError:
|
|
print("TypeError")
|
|
|
|
try:
|
|
super(0, int)
|
|
except TypeError:
|
|
print("TypeError")
|