[f2py] Fwd: callback functions raising exceptions?
Marek Wojciechowski
wojciechowski_m at o2.pl
Fri Jan 19 02:21:07 EET 2007
Hi all f2py users,
I'd like to share with you the problem I run into lately. Namely:
If a wrapped fortran routine runs STOP statement, python program calling
it stops as well. Supposing
i run python interpreter interactively (ipython), the whole session is
lost this way. Obviously
this is not expected behavior. It would be great to have an exception here
instead.
I wrote a function in python which just raises RuntimeError and i injected
it into fortran as a
callback function (replacing STOP). But this does not work well, simply
because raising exception in
callback does not end fortran code execution.
Maybe you have ideas how to handle this in a smarter way. Is there
a mechanism to raise exceptions directly from fortran?
Greetings
--
Marek Wojciechowski
More information about the f2py-users
mailing list