Skip to content

Commit 28d8367

Browse files
committed
api: fix non-integer Mul args
1 parent eb11e49 commit 28d8367

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

devito/finite_differences/differentiable.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,10 +552,8 @@ def __new__(cls, *args, **kwargs):
552552
nums, others = split(args, lambda e: isinstance(e, (int, float,
553553
sympy.Number, np.number)))
554554
scalar = sympy.Mul(*nums)
555-
try:
555+
if int(scalar) - scalar == 0:
556556
scalar = sympy.Integer(scalar)
557-
except TypeError:
558-
pass
559557

560558
# a*0 -> 0
561559
if scalar == 0:

0 commit comments

Comments
 (0)