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

numpy-svn at scipy.org numpy-svn at scipy.org
Thu Aug 24 12:35:11 EDT 2006


Author: oliphant
Date: 2006-08-24 11:35:08 -0500 (Thu, 24 Aug 2006)
New Revision: 3059

Modified:
   trunk/numpy/core/src/multiarraymodule.c
Log:
Make sure test_interrupt ends at some point.

Modified: trunk/numpy/core/src/multiarraymodule.c
===================================================================
--- trunk/numpy/core/src/multiarraymodule.c	2006-08-24 16:12:59 UTC (rev 3058)
+++ trunk/numpy/core/src/multiarraymodule.c	2006-08-24 16:35:08 UTC (rev 3059)
@@ -6430,23 +6430,20 @@
 }
 
 
-#ifndef NPY_NO_SIGNAL
-
 static PyObject *
 test_interrupt(PyObject *self)
 {
-        npy_ulonglong a = 0;
+        int a = 0;
         NPY_SIGINT_ON
 
-        while(1) {
+        while(a>=0) {
             a += 1;
         }
 
         NPY_SIGINT_OFF
             
-        return PyLong_FromUnsignedLongLong(a);
+        return PyInt_FromLong(a);
 }
-#endif
 
 static struct PyMethodDef array_module_methods[] = {
 	{"_get_ndarray_c_version", (PyCFunction)array__get_ndarray_c_version,
@@ -6502,10 +6499,8 @@
          METH_VARARGS | METH_KEYWORDS, NULL},
         {"compare_chararrays", (PyCFunction)compare_chararrays,
          METH_VARARGS | METH_KEYWORDS, NULL},
-#ifndef NPY_NO_SIGNAL
         {"test_interrupt", (PyCFunction)test_interrupt,
          METH_NOARGS, NULL},
-#endif
 	{NULL,		NULL, 0}		/* sentinel */
 };
 




More information about the Numpy-svn mailing list