[pypy-svn] r73234 - pypy/branch/cpython-extension/pypy/module/cpyext

fijal at codespeak.net fijal at codespeak.net
Wed Mar 31 23:38:52 CEST 2010


Author: fijal
Date: Wed Mar 31 23:38:50 2010
New Revision: 73234

Modified:
   pypy/branch/cpython-extension/pypy/module/cpyext/api.py
Log:
export a bit more exceptions


Modified: pypy/branch/cpython-extension/pypy/module/cpyext/api.py
==============================================================================
--- pypy/branch/cpython-extension/pypy/module/cpyext/api.py	(original)
+++ pypy/branch/cpython-extension/pypy/module/cpyext/api.py	Wed Mar 31 23:38:50 2010
@@ -217,12 +217,14 @@
     'Py_None': ('PyObject*', 'space.w_None'),
     'Py_True': ('PyObject*', 'space.w_True'),
     'Py_False': ('PyObject*', 'space.w_False'),
-    'PyExc_Exception': ('PyObject*', 'space.w_Exception'),
-    'PyExc_TypeError': ('PyObject*', 'space.w_TypeError'),
     'PyType_Type#': ('PyTypeObject*', 'space.w_type'),
     'PyBaseObject_Type#': ('PyTypeObject*', 'space.w_object'),
     }
 
+for exc_name in ['TypeError', 'ValueError', 'KeyError', 'Exception',
+                 'BaseException']:
+    GLOBALS['PyExc_' + exc_name] = ('PyObject*', 'space.w_' + exc_name)
+
 def get_structtype_for_ctype(ctype):
     from pypy.module.cpyext.typeobjectdefs import PyTypeObjectPtr
     return {"PyObject*": PyObject, "PyTypeObject*": PyTypeObjectPtr}[ctype]



More information about the Pypy-commit mailing list