mailr26127 - /trunk/lib/arg_check.py


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

Header


Content

Posted by edward on October 01, 2014 - 19:56:
Author: bugman
Date: Wed Oct  1 19:56:54 2014
New Revision: 26127

URL: http://svn.gna.org/viewcvs/relax?rev=26127&view=rev
Log:
Modified the lib.arg_check.is_str_or_inst() function to work with Python 3.

Instead of checking for cStringIO.OutputType, which does not exist in Python 
3, the argument is
simply checked to see if it has a write() method.


Modified:
    trunk/lib/arg_check.py

Modified: trunk/lib/arg_check.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/arg_check.py?rev=26127&r1=26126&r2=26127&view=diff
==============================================================================
--- trunk/lib/arg_check.py      (original)
+++ trunk/lib/arg_check.py      Wed Oct  1 19:56:54 2014
@@ -24,7 +24,6 @@
 """Argument checking functions for the relax user functions."""
 
 # Python module imports.
-from cStringIO import OutputType
 from numpy import ndarray
 
 # relax module imports.
@@ -1012,7 +1011,7 @@
         return True
 
     # Check for a string.
-    if isinstance(arg, str) or lib.check_types.is_filetype(arg) or 
isinstance(arg, DummyFileObject) or isinstance(arg, OutputType):
+    if isinstance(arg, str) or lib.check_types.is_filetype(arg) or 
isinstance(arg, DummyFileObject) or hasattr(arg, 'write'):
         return True
 
     # Fail.




Related Messages


Powered by MHonArc, Updated Wed Oct 01 21:00:02 2014