summaryrefslogtreecommitdiff
path: root/numpy/core/defchararray.py
diff options
context:
space:
mode:
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 = ''