Skip to content

Commit 1914aca

Browse files
committed
Add a test.
1 parent 345ad57 commit 1914aca

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Lib/test/test_types.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,19 @@ def test_traceback_and_frame_types(self):
646646
def test_capsule_type(self):
647647
self.assertIsInstance(_datetime.datetime_CAPI, types.CapsuleType)
648648

649+
def test_gh131998(self):
650+
# GH-131998: The specialized instruction would get tricked into dereferencing
651+
# a bound "self" that didn't exist if subsequently called unbound.
652+
def call(part):
653+
part.pop()
654+
655+
656+
try:
657+
call(["a"])
658+
call(list)
659+
except:
660+
pass
661+
649662

650663
class UnionTests(unittest.TestCase):
651664

0 commit comments

Comments
 (0)