Author: Armin Rigo <ar...@tunes.org>
Branch: release-pypy3.5-v5.9.x
Changeset: r93590:56f9a3f7b588
Date: 2017-12-25 09:30 +0100
http://bitbucket.org/pypy/pypy/changeset/56f9a3f7b588/

Log:    Fix 248a5a9859ef (probably) (grafted from
        36cb02a2cd901f153c8da24196fe3b676235c43f)

diff --git a/pypy/interpreter/timeutils.py b/pypy/interpreter/timeutils.py
--- a/pypy/interpreter/timeutils.py
+++ b/pypy/interpreter/timeutils.py
@@ -4,6 +4,7 @@
 import math
 from rpython.rlib.rarithmetic import (
     r_longlong, ovfcheck, ovfcheck_float_to_longlong)
+from rpython.rlib import rfloat
 from pypy.interpreter.error import oefmt
 
 SECS_TO_NS = 10 ** 9
@@ -21,6 +22,8 @@
 def timestamp_w(space, w_secs):
     if space.isinstance_w(w_secs, space.w_float):
         secs = space.float_w(w_secs)
+        if rfloat.isnan(secs):
+            raise oefmt(space.w_ValueError, "timestamp is nan")
         result_float = math.ceil(secs * SECS_TO_NS)
         try:
             return ovfcheck_float_to_longlong(result_float)
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to