mailr17663 - /trunk/relax_errors.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on October 02, 2012 - 14:18:
Author: bugman
Date: Tue Oct  2 14:18:41 2012
New Revision: 17663

URL: http://svn.gna.org/viewcvs/relax?rev=17663&view=rev
Log:
Python 3 fix - the relax_errors.AllRelaxErrors object is now a proper tuple.

Due to bad coding, it was previously a nested tuple.  This nested tuple 
worked in Python 2, but is
fatal for Python 3.


Modified:
    trunk/relax_errors.py

Modified: trunk/relax_errors.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/relax_errors.py?rev=17663&r1=17662&r2=17663&view=diff
==============================================================================
--- trunk/relax_errors.py (original)
+++ trunk/relax_errors.py Tue Oct  2 14:18:41 2012
@@ -1014,7 +1014,7 @@
     """Function for returning all the RelaxErrors to allow the AllRelaxError 
object to be created."""
 
     # Empty list.
-    list = None
+    list = []
 
     # Loop over all objects of this module.
     for name in names:
@@ -1025,14 +1025,11 @@
         if not (isinstance(object, type(RelaxError)) or isinstance(object, 
type(type))) or not match('Relax', name):
             continue
 
-        # Tuple of all the errors.
-        if list == None:
-            list = object,
-        else:
-            list = list, object
+        # Append to the list.
+        list.append(object)
 
     # Return the list of RelaxErrors
     return list
 
-# Initialise the AllRelaxErrors structure so it can be imported.
-AllRelaxErrors = all_errors(dir())
+# Initialise the AllRelaxErrors structure, as a tuple for the except 
statements, so it can be imported.
+AllRelaxErrors = tuple(all_errors(dir()))




Related Messages


Powered by MHonArc, Updated Tue Oct 02 14:40:02 2012