• Michael W. Hudson's avatar
    Fixes for · da6242c8
    Michael W. Hudson yazdı
    [ 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).
    da6242c8
readline.c 21.9 KB