Skip to content

Commit

Permalink
misc: Replace try-except with if-else
Browse files Browse the repository at this point in the history
  • Loading branch information
EdCaunt committed Sep 16, 2024
1 parent 925037b commit de56705
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions devito/ir/equations/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,9 +264,9 @@ def _(d, mapper, rebuilt, sregistry):

idim0 = d.implicit_dimension
if idim0 is not None:
try:
if idim0 in rebuilt:
idim1 = rebuilt[idim0]
except KeyError:
else:
iname = sregistry.make_name(prefix='n')
rebuilt[idim0] = idim1 = idim0._rebuild(name=iname)

Expand All @@ -275,9 +275,9 @@ def _(d, mapper, rebuilt, sregistry):
'halo': None,
'padding': None})

try:
if d.functions in rebuilt:
functions = rebuilt[d.functions]
except KeyError:
else:
fkwargs.update({'name': sregistry.make_name(prefix=d.functions.name),
'function': None})

Expand Down

0 comments on commit de56705

Please sign in to comment.