Author: bugman
Date: Fri Feb 20 16:51:33 2015
New Revision: 27709

URL: http://svn.gna.org/viewcvs/relax?rev=27709&view=rev
Log:
Python 3 fix for the internal structural object MolContainer._sort_key() method.

This method is used as the key for the sort() function.  However in Python 3, 
the key cannot be
None.  So now if the residue number is None, the value of 0 is returned instead.


Modified:
    trunk/lib/structure/internal/molecules.py

Modified: trunk/lib/structure/internal/molecules.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/structure/internal/molecules.py?rev=27709&r1=27708&r2=27709&view=diff
==============================================================================
--- trunk/lib/structure/internal/molecules.py   (original)
+++ trunk/lib/structure/internal/molecules.py   Fri Feb 20 16:51:33 2015
@@ -285,6 +285,10 @@
     def _sort_key(self, i):
         """Return the information for sorting the sequence data."""
 
+        # Python 3 - return 0 instead of None.
+        if self.res_num[i] == None:
+            return 0
+
         # Sort based on residue number.
         return self.res_num[i]
 


_______________________________________________
relax (http://www.nmr-relax.com)

This is the relax-commits mailing list
[email protected]

To unsubscribe from this list, get a password
reminder, or change your subscription options,
visit the list information page at
https://mail.gna.org/listinfo/relax-commits

Reply via email to