Skip to content

Commit 2363ea2

Browse files
committed
Implemented @tlunet's suggestion
1 parent 76ace2d commit 2363ea2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pySDC/implementations/datatype_classes/firedrake_mesh.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ def __rmul__(self, other):
6060
fenics_mesh: copy of original values scaled by factor
6161
"""
6262

63-
if type(other) in [int, float, complex]:
63+
try:
6464
me = firedrake_mesh(self)
6565
me.functionspace.assign(other * self.functionspace)
6666
return me
67-
else:
67+
except TypeError:
6868
raise DataError("Type error: cannot multiply %s to %s" % (type(other), type(self)))
6969

7070
def __abs__(self):

0 commit comments

Comments
 (0)