Author: bugman Date: Tue Oct 9 21:06:42 2012 New Revision: 17794 URL: http://svn.gna.org/viewcvs/relax?rev=17794&view=rev Log: Python 2.4 and earlier fix for the GUI. Try-except-finally statement blocks are not supported, so these have to nested in two try statements. Modified: trunk/gui/interpreter.py Modified: trunk/gui/interpreter.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/interpreter.py?rev=17794&r1=17793&r2=17794&view=diff ============================================================================== --- trunk/gui/interpreter.py (original) +++ trunk/gui/interpreter.py Tue Oct 9 21:06:42 2012 @@ -303,21 +303,22 @@ # Execution lock. status.exec_lock.acquire('gui', mode='interpreter thread') - # Execute the user function, catching errors. + # Execute the user function, catching errors (the nested try-except statements within the try-finally statements are for Python 2.4 and earlier support). try: - apply(fn, args, kwds) - - # Catch all RelaxErrors. - except AllRelaxErrors: - instance = sys.exc_info()[1] - - # Display a dialog with the error. - wx.CallAfter(gui_raise, instance, raise_flag=False) - - # Handle all other errors. - except: - # Print the exception. - print_exc() + try: + apply(fn, args, kwds) + + # Catch all RelaxErrors. + except AllRelaxErrors: + instance = sys.exc_info()[1] + + # Display a dialog with the error. + wx.CallAfter(gui_raise, instance, raise_flag=False) + + # Handle all other errors. + except: + # Print the exception. + print_exc() # Release the lock. finally: