mailr17687 - /trunk/relax_io.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 - 18:55:
Author: bugman
Date: Tue Oct  2 18:55:31 2012
New Revision: 17687

URL: http://svn.gna.org/viewcvs/relax?rev=17687&view=rev
Log:
Another Python 3 fix for the relax_io.extract_data() function.

Sometimes this function sees byte types, sometimes string types.  The 
function can now handle both.


Modified:
    trunk/relax_io.py

Modified: trunk/relax_io.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/relax_io.py?rev=17687&r1=17686&r2=17687&view=diff
==============================================================================
--- trunk/relax_io.py (original)
+++ trunk/relax_io.py Tue Oct  2 18:55:31 2012
@@ -152,7 +152,7 @@
     data = []
     for i in range(len(file_data)):
         # Python 3 support - conversion of bytes type objects to strings.
-        if py_version == 3:
+        if py_version == 3 and hasattr(file_data[i], 'decode'):
             file_data[i] = file_data[i].decode()
 
         if sep:




Related Messages


Powered by MHonArc, Updated Tue Oct 02 19:00:02 2012