https://github.com/python/cpython/commit/63ddd28cf3e4a9a11a39d03418c5ad92785af4ff
commit: 63ddd28cf3e4a9a11a39d03418c5ad92785af4ff
branch: main
author: Jelle Zijlstra <[email protected]>
committer: hauntsaninja <[email protected]>
date: 2024-07-18T04:02:08-04:00
summary:

gh-121921: Make bogus_code_obj.py crash the interpreter (#121922)

files:
A Misc/NEWS.d/next/Tests/2024-07-17-08-25-06.gh-issue-121921.HW8CIS.rst
M Lib/test/crashers/bogus_code_obj.py

diff --git a/Lib/test/crashers/bogus_code_obj.py 
b/Lib/test/crashers/bogus_code_obj.py
index e71b3582cf2d76..b3ff07995c95ed 100644
--- a/Lib/test/crashers/bogus_code_obj.py
+++ b/Lib/test/crashers/bogus_code_obj.py
@@ -12,8 +12,8 @@
 
 """
 
-import types
+def f():
+    pass
 
-co = types.CodeType(0, 0, 0, 0, 0, 0, b'\x04\x00\x71\x00',
-                    (), (), (), '', '', 1, b'')
-exec(co)
+f.__code__ = f.__code__.replace(co_code=b"")
+f()
diff --git 
a/Misc/NEWS.d/next/Tests/2024-07-17-08-25-06.gh-issue-121921.HW8CIS.rst 
b/Misc/NEWS.d/next/Tests/2024-07-17-08-25-06.gh-issue-121921.HW8CIS.rst
new file mode 100644
index 00000000000000..ef14fa9dfbd466
--- /dev/null
+++ b/Misc/NEWS.d/next/Tests/2024-07-17-08-25-06.gh-issue-121921.HW8CIS.rst
@@ -0,0 +1,2 @@
+Update ``Lib/test/crashers/bogus_code_obj.py`` so that it crashes properly
+again.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to