Author: bugman Date: Mon Oct 1 22:22:34 2012 New Revision: 17631 URL: http://svn.gna.org/viewcvs/relax?rev=17631&view=rev Log: Python 3 - converted the last of the except error catching statements to be Python 2.4+ compatible. Modified: trunk/generic_fns/sequence.py trunk/gui/interpreter.py trunk/gui/misc.py trunk/gui/uf_objects.py trunk/multi/processor.py trunk/scons/install.py trunk/scons/manuals.py trunk/test_suite/gui_tests/dead_uf_pages.py Modified: trunk/generic_fns/sequence.py URL: http://svn.gna.org/viewcvs/relax/trunk/generic_fns/sequence.py?rev=17631&r1=17630&r2=17631&view=diff ============================================================================== --- trunk/generic_fns/sequence.py (original) +++ trunk/generic_fns/sequence.py Mon Oct 1 22:22:34 2012 @@ -26,7 +26,7 @@ from arg_check import is_int from generic_fns.interatomic import return_interatom_list from generic_fns.mol_res_spin import count_molecules, count_residues, count_spins, create_molecule, create_residue, create_spin, exists_mol_res_spin_data, generate_spin_id, return_molecule, return_residue, return_spin, set_spin_element, set_spin_isotope, spin_id_to_data_list, spin_loop -import pipes +from generic_fns import pipes from relax_errors import RelaxError, RelaxDiffMolNumError, RelaxDiffResNumError, RelaxDiffSeqError, RelaxDiffSpinNumError, RelaxFileEmptyError, RelaxInvalidSeqError, RelaxNoSequenceError, RelaxSequenceError from relax_io import open_write_file, read_spin_data, write_spin_data import sys Modified: trunk/gui/interpreter.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/interpreter.py?rev=17631&r1=17630&r2=17631&view=diff ============================================================================== --- trunk/gui/interpreter.py (original) +++ trunk/gui/interpreter.py Mon Oct 1 22:22:34 2012 @@ -112,7 +112,9 @@ apply(fn, args, kwds) # Catch all RelaxErrors. - except AllRelaxErrors, instance: + except AllRelaxErrors: + instance = sys.exc_info()[1] + # Display a dialog with the error. gui_raise(instance, raise_flag=False) @@ -303,7 +305,9 @@ apply(fn, args, kwds) # Catch all RelaxErrors. - except AllRelaxErrors, instance: + except AllRelaxErrors: + instance = sys.exc_info()[1] + # Display a dialog with the error. wx.CallAfter(gui_raise, instance, raise_flag=False) Modified: trunk/gui/misc.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/misc.py?rev=17631&r1=17630&r2=17631&view=diff ============================================================================== --- trunk/gui/misc.py (original) +++ trunk/gui/misc.py Mon Oct 1 22:22:34 2012 @@ -307,7 +307,9 @@ apply(fn, args, kargs) # Catch RelaxErrors. - except AllRelaxErrors, instance: + except AllRelaxErrors: + instance = sys.exc_info()[1] + # Raise the error in debugging mode. if status.debug: raise Modified: trunk/gui/uf_objects.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/uf_objects.py?rev=17631&r1=17630&r2=17631&view=diff ============================================================================== --- trunk/gui/uf_objects.py (original) +++ trunk/gui/uf_objects.py Mon Oct 1 22:22:34 2012 @@ -910,7 +910,9 @@ data.append(vals) # Catch all RelaxErrors. - except AllRelaxErrors, instance: + except AllRelaxErrors: + instance = sys.exc_info()[1] + # Signal the failure to the wizard. self.setup_fail = True Modified: trunk/multi/processor.py URL: http://svn.gna.org/viewcvs/relax/trunk/multi/processor.py?rev=17631&r1=17630&r2=17631&view=diff ============================================================================== --- trunk/multi/processor.py (original) +++ trunk/multi/processor.py Mon Oct 1 22:22:34 2012 @@ -487,7 +487,8 @@ raise # Handle all errors nicely. - except Exception, e: + except Exception: + e = sys.exc_info()[1] self.callback.handle_exception(self, e) # Execution of the slave processor. Modified: trunk/scons/install.py URL: http://svn.gna.org/viewcvs/relax/trunk/scons/install.py?rev=17631&r1=17630&r2=17631&view=diff ============================================================================== --- trunk/scons/install.py (original) +++ trunk/scons/install.py Mon Oct 1 22:22:34 2012 @@ -86,7 +86,9 @@ try: print(("\nCopying all files in " + repr(getcwd()) + " to " + repr(env['RELAX_PATH']) + ".")) copytree(getcwd(), env['RELAX_PATH']) - except OSError, message: + except OSError: + message = sys.exc_info()[1] + # Failure message. sys.stderr.write("Cannot install relax, " + message.__doc__ + "\n") Modified: trunk/scons/manuals.py URL: http://svn.gna.org/viewcvs/relax/trunk/scons/manuals.py?rev=17631&r1=17630&r2=17631&view=diff ============================================================================== --- trunk/scons/manuals.py (original) +++ trunk/scons/manuals.py Mon Oct 1 22:22:34 2012 @@ -67,7 +67,9 @@ for file in files: try: remove(file) - except OSError, message: + except OSError: + message = sys.exc_info()[1] + # The file does not exist. if message.errno == 2: pass Modified: trunk/test_suite/gui_tests/dead_uf_pages.py URL: http://svn.gna.org/viewcvs/relax/trunk/test_suite/gui_tests/dead_uf_pages.py?rev=17631&r1=17630&r2=17631&view=diff ============================================================================== --- trunk/test_suite/gui_tests/dead_uf_pages.py (original) +++ trunk/test_suite/gui_tests/dead_uf_pages.py Mon Oct 1 22:22:34 2012 @@ -44,7 +44,8 @@ try: # Call the object. self._execute_uf(uf_name='molecule.create', mol_name='x', mol_type='protein') - except RelaxNoPipeError as instance: + except RelaxNoPipeError: + instance = sys.exc_info()[1] sys.stderr.write(instance.__str__()) # Create a data pipe.