mailr27709 - /trunk/lib/structure/internal/molecules.py


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

Header


Content

Posted by edward on February 20, 2015 - 16:51:
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]
 




Related Messages


Powered by MHonArc, Updated Fri Feb 20 17:00:03 2015