Skip to content

Commit d7778d5

Browse files
fix: something Shantanu found
to be honest I have no idea what this code does, but I know we need to fix it
1 parent dce8e1c commit d7778d5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

mypy/strconv.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,9 @@ def visit_name_expr(self, o: mypy.nodes.NameExpr) -> str:
388388
o.name, o.kind, o.fullname, o.is_inferred_def or o.is_special_form, o.node
389389
)
390390
if isinstance(o.node, mypy.nodes.Var) and o.node.is_final:
391-
pretty += f" = {o.node.final_value}"
391+
final_value = o.node.final_value
392+
if final_value is not None:
393+
pretty += f" = {o.node.final_value}"
392394
return short_type(o) + "(" + pretty + ")"
393395

394396
def pretty_name(

0 commit comments

Comments
 (0)