Use math.isfinite instead of explicitly checking for both nan and inf (#98103)
This commit is contained in:
@@ -1934,7 +1934,7 @@ def is_number(value):
|
||||
fvalue = float(value)
|
||||
except (ValueError, TypeError):
|
||||
return False
|
||||
if math.isnan(fvalue) or math.isinf(fvalue):
|
||||
if not math.isfinite(fvalue):
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
Reference in New Issue
Block a user