[Numpy-svn] r3235 - trunk/numpy/core/src

numpy-svn at scipy.org numpy-svn at scipy.org
Fri Sep 29 13:02:36 CDT 2006


Author: oliphant
Date: 2006-09-29 13:02:25 -0500 (Fri, 29 Sep 2006)
New Revision: 3235

Modified:
   trunk/numpy/core/src/arraytypes.inc.src
Log:
Only use the LongLong conversion if negative conversion worked.

Modified: trunk/numpy/core/src/arraytypes.inc.src
===================================================================
--- trunk/numpy/core/src/arraytypes.inc.src	2006-09-29 17:58:55 UTC (rev 3234)
+++ trunk/numpy/core/src/arraytypes.inc.src	2006-09-29 18:02:25 UTC (rev 3235)
@@ -54,7 +54,9 @@
                 longlong new;
                 PyErr_Clear();
                 new = PyLong_AsLongLong(vv);
-                ret = (ulonglong) new;
+                if (!PyErr_Occurred() && new < 0)
+                        ret = (ulonglong) new;
+                ret = NPY_MAX_ULONGLONG;
         }
         Py_DECREF(vv);
         return ret;



More information about the Numpy-svn mailing list