diff options
author | Travis Oliphant <oliphant@enthought.com> | 2007-05-16 07:10:37 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2007-05-16 07:10:37 +0000 |
commit | 07b1228e1e45d8f4d4e6c74520cc6106515638ba (patch) | |
tree | 347b4d46c6abc93d26e623ffa9dbd67b9c1707cd /numpy/core/src/arrayobject.c | |
parent | f79ec5f6b1aa74bac292bf9938ddd334bdbc85ab (diff) | |
download | numpy-07b1228e1e45d8f4d4e6c74520cc6106515638ba.tar.gz |
Fixed a place where unicode itemsize was being counted twice. This led to array([u'abc'],'U') returning the wrong itemsize.
Diffstat (limited to 'numpy/core/src/arrayobject.c')
-rw-r--r-- | numpy/core/src/arrayobject.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/numpy/core/src/arrayobject.c b/numpy/core/src/arrayobject.c index 3e4e7f666..200100323 100644 --- a/numpy/core/src/arrayobject.c +++ b/numpy/core/src/arrayobject.c @@ -6859,10 +6859,7 @@ discover_itemsize(PyObject *s, int nd, int *itemsize) if ((nd == 0) || PyString_Check(s) || \ PyUnicode_Check(s) || PyBuffer_Check(s)) { - if PyUnicode_Check(s) - *itemsize = MAX(*itemsize, 4*n); - else - *itemsize = MAX(*itemsize, n); + *itemsize = MAX(*itemsize, n); return 0; } for (i=0; i<n; i++) { |