[Cython] Raising exceptions under python 2.5

Johannes Wienke languitar at semipol.de
Mon Jul 14 13:25:04 CEST 2008


Hi again,

I've developed my project under python 2.4 and now I got to get it
running under 2.5. The main problem I notice at the moment with the
cython party is raising exceptions. Running the project I get constant
errors of the form:

Traceback (most recent call last):
  File "/tmp/shIP/test/shiptests/datatest.py", line 49, in testStartData
    self.__dataStore.addDataObserver(DataStore.START_IDENT, plugin1)
  File "data.pyx", line 535, in ship.data.DataStore.addDataObserver
(build/temp.linux-i686-2.5/pyrex/data.c:4314)
  File "data.pyx", line 472, in ship.data.DataStore.__addToObserverDict
(build/temp.linux-i686-2.5/pyrex/data.c:3908)
  File "data.pyx", line 558, in ship.data.DataStore.__findObserverItem
(build/temp.linux-i686-2.5/pyrex/data.c:4478)
TypeError: raise: exception must be an old-style class or instance

The line contains:
raise KeyError("No _ObserverItem found belonging to '%s'." % observer)

I thought this is the preferred way of raising exceptions. Why is cython
/ python complaining about this?

Thanks for the help
Johannes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 260 bytes
Desc: OpenPGP digital signature
Url : http://codespeak.net/pipermail/cython-dev/attachments/20080714/1e042005/attachment.pgp 


More information about the Cython-dev mailing list