diff --git a/IPython/Shell.py b/IPython/Shell.py index 3a62089..71ebe82 100644 --- a/IPython/Shell.py +++ b/IPython/Shell.py @@ -4,7 +4,7 @@ All the matplotlib support code was co-developed with John Hunter, matplotlib's author. -$Id: Shell.py 1079 2006-01-24 21:52:31Z vivainio $""" +$Id: Shell.py 1297 2006-05-13 19:14:48Z fperez $""" #***************************************************************************** # Copyright (C) 2001-2006 Fernando Perez @@ -337,7 +337,7 @@ class MTInteractiveShell(InteractiveShell): Multithreaded wrapper around IPython's runcode().""" # lock thread-protected stuff - self.thread_ready.acquire(False) + got_lock = self.thread_ready.acquire(False) # Install sigint handler try: @@ -365,7 +365,8 @@ class MTInteractiveShell(InteractiveShell): InteractiveShell.runcode(self,code_to_run) # We're done with thread-protected variables - self.thread_ready.release() + if got_lock: + self.thread_ready.release() # This MUST return true for gtk threading to work return True diff --git a/doc/ChangeLog b/doc/ChangeLog index 366744d..c253d6b 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,10 @@ +2006-05-13 Fernando Perez + + * IPython\Shell.py (MTInteractiveShell.runsource): Fix threading + bug, closes http://www.scipy.net/roundup/ipython/issue55. A lock + was being released in a routine which hadn't checked if it had + been the one to acquire it. + 2006-05-07 Fernando Perez * IPython/Release.py (version): put out 0.7.2.rc1 for testing.