]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Backport:
authorMichael W. Hudson <mwh@python.net>
Thu, 31 Mar 2005 10:20:34 +0000 (10:20 +0000)
committerMichael W. Hudson <mwh@python.net>
Thu, 31 Mar 2005 10:20:34 +0000 (10:20 +0000)
commit59f9bea8738b5811650c53961d9a6036c3b9bcbe
tree5a0cde3ac414dfd4a1c746e3db79dd297e7a81a7
parent4cf27049b68a2c1dca643638f319966ba3fae4ee
Backport:

Fixes for

1166660 ] The readline module can cause python to segfault

It seems to me that the code I'm rewriting here attempted to call any
user-supplied hook functions using the thread state of the thread that
called the hook-setting function, as opposed to that of the thread
that is currently executing.  This doesn't work, in general.

Fix this by using the PyGILState API (It wouldn't be that hard to
define a dummy version of said API when #ifndef WITH_THREAD, would
it?).

Also, check the conversion to integer of the return value of a hook
function for errors (this problem was mentioned in the ipython bug
report linked to in the above bug).
Misc/NEWS
Modules/readline.c