Skip to content

Commit

Permalink
IR: Make import of parser local, to avoid cyclic imports
Browse files Browse the repository at this point in the history
  • Loading branch information
mlange05 committed Sep 5, 2024
1 parent b9a815f commit 352ef8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion loki/ir/expr_visitors.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from loki.ir.visitor import Visitor
from loki.ir.transformer import Transformer
from loki.tools import flatten, as_tuple
from loki.expression.parser import parse_expr
from loki.expression.mappers import (
SubstituteExpressionsMapper, ExpressionRetriever, AttachScopesMapper
)
Expand Down Expand Up @@ -281,6 +280,7 @@ class SubstituteStringExpressions(SubstituteExpressions):
retain that information
"""
def __init__(self, str_map, scope, invalidate_source=True):
from loki.expression.parser import parse_expr # pylint: disable=import-outside-toplevel,cyclic-import
expr_map = {
parse_expr(k, scope=scope): parse_expr(v, scope=scope)
for k, v in str_map.items()
Expand Down

0 comments on commit 352ef8d

Please sign in to comment.