summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2008-05-26 22:08:35 +0000
committerCharles Harris <charlesr.harris@gmail.com>2008-05-26 22:08:35 +0000
commit24caeed5a1dfc1a90cbfc27d0ac9c154cee0af58 (patch)
tree9a585d7abff53a3ea8e37749371d7f647d938429
parent207754f3e7e0d1e014a60a0b10b3c3c75dabed14 (diff)
downloadnumpy-24caeed5a1dfc1a90cbfc27d0ac9c154cee0af58.tar.gz
Fix regression in dtype='c' array creation.
-rw-r--r--numpy/core/src/arrayobject.c5
-rw-r--r--numpy/core/tests/test_regression.py5
2 files changed, 8 insertions, 2 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c
index cd934424d..7398a2263 100644
--- a/numpy/core/src/arrayobject.c
+++ b/numpy/core/src/arrayobject.c
@@ -13,7 +13,8 @@
Travis Oliphant, oliphant@ee.byu.edu
Brigham Young Univeristy
- maintainer email: oliphant.travis@ieee.org
+:8613
+maintainer email: oliphant.travis@ieee.org
Numarray design (which provided guidance) by
Space Science Telescope Institute
@@ -8801,7 +8802,7 @@ PyArray_FromAny(PyObject *op, PyArray_Descr *newtype, int min_depth,
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 */
diff --git a/numpy/core/tests/test_regression.py b/numpy/core/tests/test_regression.py
index eae1a3c4b..390c80093 100644
--- a/numpy/core/tests/test_regression.py
+++ b/numpy/core/tests/test_regression.py
@@ -1079,5 +1079,10 @@ class TestRegression(NumpyTestCase):
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()