Skip to content

Commit

Permalink
Fix a deprecated usage of pymbolic.p.Comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
inducer committed Nov 4, 2024
1 parent ba4d67c commit c8ed2e3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion modepy/modes.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@ def _cse(expr, prefix):
def _where(op_a, comp, op_b, then, else_):
from pymbolic.primitives import Comparison, Expression, If
if isinstance(op_a, Expression) or isinstance(op_b, Expression):
return If(Comparison(op_a, comp, op_b), then, else_)
return If(
Comparison(op_a, Comparison.name_to_operator[comp], op_b),
then, else_)

import operator
comp_op = getattr(operator, comp)
Expand Down

0 comments on commit c8ed2e3

Please sign in to comment.