Calling C Function Pointers from Python
Alex Martelli
alex at magenta.com
Sun Jul 30 11:38:58 EDT 2000
"Neil Hodgson" <neilh at scintilla.org> wrote in message
news:0mVg5.16257$4p3.129481 at news-server.bigpond.net.au...
[snip]
> And then you'll run into opposition from people who think that this is
> too dangerous. You can crash Python easily with
>
> calldll.call_foreign_function(0,"l","l",(0,))
Couldn't the call_foreign_function be internally wrapped in a
best-try attempt at handling any resulting errors more
gracefully than with a crash? E.g., on Win/NT, a SEH
__try/__except; on Unix, a local attempt to handle any and
all 'signal's resulting from wild pointers, etc. No 100%
safety by any means, of course, but maybe still better...?
Alex
More information about the Python-list
mailing list