From 9e88585917a0721bb3ad8aa37847a5288ad0b14e Mon Sep 17 00:00:00 2001 From: James Hilton-Balfe Date: Fri, 22 Apr 2022 10:46:47 +0100 Subject: [PATCH] Update src/betterproto/__init__.py Co-authored-by: Arun Babu Neelicattu --- src/betterproto/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/betterproto/__init__.py b/src/betterproto/__init__.py index caed82f8f..2faa12236 100644 --- a/src/betterproto/__init__.py +++ b/src/betterproto/__init__.py @@ -467,7 +467,7 @@ def _dump_float(value: float) -> Union[float, str]: return INFINITY if value == -float("inf"): return NEG_INFINITY - if math.isnan(value): + if isinstance(value, float) and math.isnan(value): return NAN return value