mailr17684 - /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:34:
Author: bugman
Date: Tue Oct  2 18:34:02 2012
New Revision: 17684

URL: http://svn.gna.org/viewcvs/relax?rev=17684&view=rev
Log:
Python 2 fix for the relax_io.extract_data() function for a bug introduced at 
r17669.


Modified:
    trunk/relax_io.py

Modified: trunk/relax_io.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/relax_io.py?rev=17684&r1=17683&r2=17684&view=diff
==============================================================================
--- trunk/relax_io.py (original)
+++ trunk/relax_io.py Tue Oct  2 18:34:02 2012
@@ -45,6 +45,7 @@
 
 # relax module imports.
 from check_types import is_filetype
+from compat import py_version
 import generic_fns
 from relax_errors import RelaxError, RelaxFileError, 
RelaxFileOverwriteError, RelaxInvalidSeqError, RelaxMissingBinaryError, 
RelaxNoInPathError, RelaxNonExecError
 from relax_warnings import RelaxWarning, RelaxFileEmptyWarning
@@ -151,7 +152,7 @@
     data = []
     for i in range(len(file_data)):
         # Python 3 support - conversion of bytes type objects to strings.
-        if hasattr(file_data[i], 'decode'):
+        if py_version == 3:
             file_data[i] = file_data[i].decode()
 
         if sep:




Related Messages


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