Skip to content

Commit fd58e42

Browse files
committed
raise error when string is passed for function
1 parent 3e5c2b9 commit fd58e42

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

dpnp/dpnp_iface_functional.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,8 @@ def piecewise(x, condlist, funclist):
368368

369369
condlen = len(condlist)
370370
try:
371+
if isinstance(funclist, str):
372+
raise TypeError
371373
funclen = len(funclist)
372374
except TypeError as e:
373375
raise TypeError("funclist must be a sequence of scalars") from e

0 commit comments

Comments
 (0)