Skip to content

Commit 5314549

Browse files
committed
Correct construct nan
1 parent d5bfd11 commit 5314549

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/python_minifier/transforms/constant_folding.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ def visit_BinOp(self, node):
3333
except Exception as e:
3434
return node
3535

36-
if math.isnan(value):
36+
if isinstance(value, float) and math.isnan(value):
3737
# There is no nan literal.
3838
new_node = ast.Call(func=ast.Name('float', ctx=ast.Load()), args=[ast.Str('nan')], keywords=[])
3939
elif isinstance(value, str):

0 commit comments

Comments
 (0)