Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion mypyc/irbuild/specialize.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,9 @@ def get_literal_str(expr: Expression) -> str | None:
if isinstance(expr, StrExpr):
return expr.value
elif isinstance(expr, RefExpr) and isinstance(expr.node, Var) and expr.node.is_final:
return str(expr.node.final_value)
final_value = expr.node.final_value
if final_value is not None:
return str(final_value)
return None

for i in range(len(exprs) - 1):
Expand Down
Loading