summaryrefslogtreecommitdiff
path: root/numpy/core/defchararray.py
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@googlemail.com>2012-04-05 21:40:49 +0200
committerCharles Harris <charlesr.harris@gmail.com>2012-04-07 11:02:15 -0600
commitb6b5ba1387d754a595838bab4dbdd80f61e0d63e (patch)
tree783664e2e68a2aa4b9c5c63fcaaebf45bd665f59 /numpy/core/defchararray.py
parent1e89ff5197cdcb9434f1595a4a2fe9ef7780d085 (diff)
downloadnumpy-b6b5ba1387d754a595838bab4dbdd80f61e0d63e.tar.gz
BUG: fix regression for indexing chararrays with empty list. Closes #1948.
Diffstat (limited to 'numpy/core/defchararray.py')
-rw-r--r--numpy/core/defchararray.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/core/defchararray.py b/numpy/core/defchararray.py
index a7b3fd1b7..b2deb6318 100644
--- a/numpy/core/defchararray.py
+++ b/numpy/core/defchararray.py
@@ -1881,7 +1881,7 @@ class chararray(ndarray):
def __getitem__(self, obj):
val = ndarray.__getitem__(self, obj)
- if issubclass(val.dtype.type, character):
+ if issubclass(val.dtype.type, character) and not _len(val) == 0:
temp = val.rstrip()
if _len(temp) == 0:
val = ''