Skip to content

Commit 4fc36c6

Browse files
committed
the only assert in a python public function removed
1 parent 7f80628 commit 4fc36c6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/matplotlib/tri/tripcolor.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,10 @@ def tripcolor(ax, *args, **kwargs):
138138
collection.set_alpha(alpha)
139139
collection.set_array(C)
140140
if norm is not None:
141-
assert(isinstance(norm, Normalize))
141+
if not isinstance(norm, Normalize):
142+
msg = "'norm' must be an instance of"
143+
msg += " 'Normalize'"
144+
raise ValueError(msg)
142145
collection.set_cmap(cmap)
143146
collection.set_norm(norm)
144147
if vmin is not None or vmax is not None:

0 commit comments

Comments
 (0)