Nick Coghlan added the comment:

Currently, both PyGILState_Ensure and PyGILState_Release just call 
PyFatal_Error if anything goes wrong. With the *Ex versions, it would be 
possible to replace those fatal errors with more conventional error handling.

For Ensure, the likely error is failing to create the thread state.

For Release, the likely error is calling it with the system in the wrong state.

I think the current API reflects a difference between an extension mindset and 
an embedding mindset. If those calls go wrong in an extension context, killing 
the entire application is likely the only thing you can reasonably do. In an 
embedded context, though, the embedding application likely has other options 
(such as reinitialising the entire Python interpreter).

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue15751>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to