]> granicus.if.org Git - python/commit
Fixes for
authorMichael W. Hudson <mwh@python.net>
Wed, 30 Mar 2005 11:21:53 +0000 (11:21 +0000)
committerMichael W. Hudson <mwh@python.net>
Wed, 30 Mar 2005 11:21:53 +0000 (11:21 +0000)
commitda6242c84498caaf147d944529877cb3dba4f674
treec30bd8e547d9ea9db8bf8d6684708ff25e96fb97
parent9a8c3142e2bc122386cd1502124cb7103a217386
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).
Modules/readline.c