summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_code.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_code.py')
-rw-r--r--Lib/test/test_code.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py
index a37ebd2..1bb138e 100644
--- a/Lib/test/test_code.py
+++ b/Lib/test/test_code.py
@@ -176,6 +176,9 @@ class CodeTest(unittest.TestCase):
self.assertEqual(co.co_filename, "filename")
self.assertEqual(co.co_name, "funcname")
self.assertEqual(co.co_firstlineno, 15)
+ #Empty code object should raise, but not crash the VM
+ with self.assertRaises(Exception):
+ exec(co)
@cpython_only
def test_closure_injection(self):