[Python-checkins] r55653 - python/branches/bcannon-objcap/tests/fail/code_constructor.py

brett.cannon python-checkins at python.org
Tue May 29 21:18:10 CEST 2007


Author: brett.cannon
Date: Tue May 29 21:18:10 2007
New Revision: 55653

Added:
   python/branches/bcannon-objcap/tests/fail/code_constructor.py   (contents, props changed)
Log:
Test that the code type's constructor no longer works.


Added: python/branches/bcannon-objcap/tests/fail/code_constructor.py
==============================================================================
--- (empty file)
+++ python/branches/bcannon-objcap/tests/fail/code_constructor.py	Tue May 29 21:18:10 2007
@@ -0,0 +1,11 @@
+"""The constructor for the 'code' type should not work."""
+def fxn():
+    pass
+
+code = type(fxn.func_code)
+try:
+    code(0, 0, 0, 0, '', (), (), (), 'test', '', 0, '')
+except TypeError:
+    pass
+else:
+    raise Exception


More information about the Python-checkins mailing list