Skip to content

Commit 63ddd28

Browse files
pythongh-121921: Make bogus_code_obj.py crash the interpreter (python#121922)
1 parent c5a6b9a commit 63ddd28

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Lib/test/crashers/bogus_code_obj.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
1313
"""
1414

15-
import types
15+
def f():
16+
pass
1617

17-
co = types.CodeType(0, 0, 0, 0, 0, 0, b'\x04\x00\x71\x00',
18-
(), (), (), '', '', 1, b'')
19-
exec(co)
18+
f.__code__ = f.__code__.replace(co_code=b"")
19+
f()
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Update ``Lib/test/crashers/bogus_code_obj.py`` so that it crashes properly
2+
again.

0 commit comments

Comments
 (0)