From dead8612c76122b1c3033a75df6d40427c2a17a7 Mon Sep 17 00:00:00 2001 From: Stefan van der Walt Date: Sun, 15 Jun 2014 15:04:40 +0200 Subject: [PATCH] Correctly compare mask to None --- skimage/morphology/watershed.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/skimage/morphology/watershed.py b/skimage/morphology/watershed.py index 7318ceea..977223a0 100644 --- a/skimage/morphology/watershed.py +++ b/skimage/morphology/watershed.py @@ -211,7 +211,7 @@ def watershed(image, markers, connectivity=None, offset=None, mask=None): # If nothing is labeled, the output is empty and we don't have to # do anything c_output = c_output.flatten() - if c_mask == None: + if c_mask is None: c_mask = np.ones(c_image.shape, np.int8).flatten() else: c_mask = c_mask.astype(np.int8).flatten()