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.


_______________________________________________
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