summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/ma/core.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/ma/core.py b/numpy/ma/core.py
index 75c7c001e..807b28c5b 100644
--- a/numpy/ma/core.py
+++ b/numpy/ma/core.py
@@ -2757,9 +2757,9 @@ class MaskedArray(ndarray):
else:
# Case 2. : With a mask in input.
# If mask is boolean, create an array of True or False
- if mask is True:
+ if mask is True and mdtype == MaskType:
mask = np.ones(_data.shape, dtype=mdtype)
- elif mask is False:
+ elif mask is False and mdtype == MaskType:
mask = np.zeros(_data.shape, dtype=mdtype)
else:
# Read the mask with the current mdtype