[Numpy-svn] r5243 - in branches/1.1.x/numpy/core: src tests
numpy-svn at scipy.org
numpy-svn at scipy.org
Mon May 26 18:21:16 EDT 2008
Author: charris
Date: 2008-05-26 17:21:13 -0500 (Mon, 26 May 2008)
New Revision: 5243
Modified:
branches/1.1.x/numpy/core/src/arrayobject.c
branches/1.1.x/numpy/core/tests/test_regression.py
Log:
Fix regression in dtype='c' array creation.
Modified: branches/1.1.x/numpy/core/src/arrayobject.c
===================================================================
--- branches/1.1.x/numpy/core/src/arrayobject.c 2008-05-26 22:15:29 UTC (rev 5242)
+++ branches/1.1.x/numpy/core/src/arrayobject.c 2008-05-26 22:21:13 UTC (rev 5243)
@@ -8801,7 +8801,7 @@
else if (newtype->type_num == PyArray_OBJECT) {
isobject = 1;
}
- if (!PyString_Check(op) && PySequence_Check(op)) {
+ if (PySequence_Check(op)) {
PyObject *thiserr = NULL;
/* necessary but not sufficient */
Modified: branches/1.1.x/numpy/core/tests/test_regression.py
===================================================================
--- branches/1.1.x/numpy/core/tests/test_regression.py 2008-05-26 22:15:29 UTC (rev 5242)
+++ branches/1.1.x/numpy/core/tests/test_regression.py 2008-05-26 22:21:13 UTC (rev 5243)
@@ -1079,5 +1079,11 @@
self.failUnlessRaises(ValueError, dp)
self.failUnlessRaises(ValueError, dp2)
+ def check_char_array_creation(self, level=rlevel):
+ a = np.array('123', dtype='c')
+ b = np.array(['1','2','3'])
+ assert_equal(a,b)
+
+
if __name__ == "__main__":
NumpyTest().run()
More information about the Numpy-svn
mailing list