Skip to content

Commit f8d0e14

Browse files
committed
BasePlot.add_item: explicit TypeError
1 parent edcd4f1 commit f8d0e14

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plotpy/plot/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1192,7 +1192,8 @@ def add_item(
11921192
z (int): the z order (optional, default=None)
11931193
autoscale (bool): autoscale the plot (optional, default=True)
11941194
"""
1195-
assert hasattr(item, "__implements__")
1195+
if not hasattr(item, "__implements__"):
1196+
raise TypeError("item must implement IBasePlotItem interface")
11961197
assert itf.IBasePlotItem in item.__implements__
11971198

11981199
if isinstance(item, qwt.QwtPlotCurve):

0 commit comments

Comments
 (0)