mailr27093 - /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 December 11, 2014 - 16:23:
Author: bugman
Date: Thu Dec 11 16:23:46 2014
New Revision: 27093

URL: http://svn.gna.org/viewcvs/relax?rev=27093&view=rev
Log:
Bug fix for the lib.arg_check.is_int_list() function for checking a list of 
lists.

This is used to check user function arguments, but was causing a RelaxError 
to be raised for all
integer list of lists user function arguments when a valid value is supplied. 
 The function has been
updated to match the is_str_list() function which does not suffer from this 
bug.


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=27093&r1=27092&r2=27093&view=diff
==============================================================================
--- trunk/lib/arg_check.py      (original)
+++ trunk/lib/arg_check.py      Thu Dec 11 16:23:46 2014
@@ -415,11 +415,11 @@
     if can_be_none and arg == None:
         return True
 
-    # Not a list.
+    # Fail if not a list.
     if not isinstance(arg, list):
         fail = True
 
-    # A list.
+    # Other checks.
     else:
         # Fail size is wrong.
         if size != None and len(arg) != size:
@@ -439,11 +439,13 @@
             if list_of_lists and isinstance(arg[i], list):
                 for j in range(len(arg[i])):
                     if not isinstance(arg[i][j], int):
+                        print "here"
                         fail = True
 
-            # Check if it is an integer.
-            if not isinstance(arg[i], int):
-                fail = True
+            # Simple list.
+            else:
+                if not isinstance(arg[i], int):
+                    fail = True
 
     # Fail.
     if fail:




Related Messages


Powered by MHonArc, Updated Thu Dec 11 17:20:03 2014