[Pyrex, Cython]Subclass basic exceptions inside Pyrex

"Daniele Pianu" <[email protected]> Tue, 30 Sep 2008 16:32:39 +0200
Newsgroups gmane.comp.python.pyrex
Message-ID <[email protected]>
I've some problems subclassing the basic extension type. The idea is
to create my own exception hierarchy inside the Pyrex code, extending
basic Python exception objects. This is my code

      cdef extern class __builtin__.Exception [object PyExc_Exception]:
        pass
      cdef class MyPyrexException( Exception ):
        pass

The Pyrex code compiles, but when I run a Python script importing the
Python module built the interpreter raise this error:

ValueError: __builtin__.Exception does not appear to be the correct type object

Thanks for your help,
Daniele