[Pyrex] Python 2.5 support fix

Eric Huss e-huss at netmeridian.com
Wed Jan 10 20:08:56 UTC 2007


Attached is a patch to improve the Python 2.5 support from Stefan Behnel
to allow Pyrex code to raise exceptions derived from BaseException (such
as KeyboardInterrupt, SystemExit, etc.).

-Eric
-------------- next part --------------
diff -u -r1.14 -r1.15
--- Nodes.py	9 Dec 2006 01:42:47 -0000	1.14
+++ Nodes.py	10 Jan 2007 20:04:45 -0000	1.15
@@ -3683,7 +3683,7 @@
             Py_INCREF(type);
         }
     }
-    else if (PyType_IsSubtype(type->ob_type, (PyTypeObject*)PyExc_Exception)) {
+    else if (PyType_IsSubtype(type->ob_type, (PyTypeObject*)PyExc_BaseException)) {
         /* Raising a new-style object (in Py2.5).
            The value should be a dummy. */
         if (value != Py_None) {


More information about the Pyrex mailing list