mailr20737 - /trunk/lib/float.py


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

Header


Content

Posted by edward on September 02, 2013 - 11:15:
Author: bugman
Date: Mon Sep  2 11:15:53 2013
New Revision: 20737

URL: http://svn.gna.org/viewcvs/relax?rev=20737&view=rev
Log:
The isInf() and isNan() functions of lib.float can now handle values of None.

If None is encountered, the functions simply return False.


Modified:
    trunk/lib/float.py

Modified: trunk/lib/float.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/float.py?rev=20737&r1=20736&r2=20737&view=diff
==============================================================================
--- trunk/lib/float.py (original)
+++ trunk/lib/float.py Mon Sep  2 11:15:53 2013
@@ -568,6 +568,10 @@
     @raise TypeError:   If obj isn't a python float.
     """
 
+    # Catch None.
+    if obj == None:
+        return False
+
     # bad result for code checking
     result = None
 
@@ -603,6 +607,10 @@
     @rtype:             bool
     @raise TypeError:   If obj isn't a python float.
     """
+
+    # Catch None.
+    if obj == None:
+        return False
 
     # bad result for code checking
     result = None




Related Messages


Powered by MHonArc, Updated Mon Sep 02 11:20:01 2013