parent
27657069ff
commit
e858e84bf9
|
@ -0,0 +1,55 @@
|
||||||
|
# HG changeset patch
|
||||||
|
# User Ronan Lamy <ronan.lamy@gmail.com>
|
||||||
|
# Date 1514473067 -3600
|
||||||
|
# Branch py3.5
|
||||||
|
# Node ID f145d85043878194d7eee33b2049063843e032d8
|
||||||
|
# Parent d7d2710e65359e1e8d69e82612cb96f2f3921de7
|
||||||
|
Fix issue #2717
|
||||||
|
|
||||||
|
diff --git a/pypy/interpreter/test/test_timeutils.py b/pypy/interpreter/test/test_timeutils.py
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..873b2b4
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/pypy/interpreter/test/test_timeutils.py
|
||||||
|
@@ -0,0 +1,13 @@
|
||||||
|
+import pytest
|
||||||
|
+from rpython.rlib.rarithmetic import r_longlong
|
||||||
|
+from pypy.interpreter.error import OperationError
|
||||||
|
+from pypy.interpreter.timeutils import timestamp_w
|
||||||
|
+
|
||||||
|
+def test_timestamp_w(space):
|
||||||
|
+ w_1_year = space.newint(365 * 24 * 3600)
|
||||||
|
+ result = timestamp_w(space, w_1_year)
|
||||||
|
+ assert isinstance(result, r_longlong)
|
||||||
|
+ assert result // 10 ** 9 == space.int_w(w_1_year)
|
||||||
|
+ w_millenium = space.mul(w_1_year, space.newint(1000))
|
||||||
|
+ with pytest.raises(OperationError): # timestamps overflow after ~300 years
|
||||||
|
+ timestamp_w(space, w_millenium)
|
||||||
|
diff --git a/pypy/interpreter/timeutils.py b/pypy/interpreter/timeutils.py
|
||||||
|
index 336426b..7918dc8 100644
|
||||||
|
--- a/pypy/interpreter/timeutils.py
|
||||||
|
+++ b/pypy/interpreter/timeutils.py
|
||||||
|
@@ -3,7 +3,7 @@ Access to the time module's high-resolution monotonic clock
|
||||||
|
"""
|
||||||
|
import math
|
||||||
|
from rpython.rlib.rarithmetic import (
|
||||||
|
- r_longlong, ovfcheck, ovfcheck_float_to_longlong)
|
||||||
|
+ r_longlong, ovfcheck_float_to_longlong)
|
||||||
|
from pypy.interpreter.error import oefmt
|
||||||
|
|
||||||
|
SECS_TO_NS = 10 ** 9
|
||||||
|
@@ -28,10 +28,10 @@ def timestamp_w(space, w_secs):
|
||||||
|
raise oefmt(space.w_OverflowError,
|
||||||
|
"timestamp %R too large to convert to C _PyTime_t", w_secs)
|
||||||
|
else:
|
||||||
|
- sec = space.int_w(w_secs)
|
||||||
|
try:
|
||||||
|
- result = ovfcheck(sec * SECS_TO_NS)
|
||||||
|
+ sec = space.bigint_w(w_secs).tolonglong()
|
||||||
|
+ result = sec * r_longlong(SECS_TO_NS)
|
||||||
|
except OverflowError:
|
||||||
|
raise oefmt(space.w_OverflowError,
|
||||||
|
- "timestamp too large to convert to C _PyTime_t")
|
||||||
|
- return r_longlong(result)
|
||||||
|
+ "timestamp %R too large to convert to C _PyTime_t", w_secs)
|
||||||
|
+ return result
|
|
@ -0,0 +1,22 @@
|
||||||
|
# HG changeset patch
|
||||||
|
# User Miro Hrončok <miro@hroncok.cz>
|
||||||
|
# Date 1514415016 0
|
||||||
|
# Branch hroncok/fix-typeerror-str-does-not-support-the-b-1514414905375
|
||||||
|
# Node ID 0551d04959425ea4a8ff7e87a5d357d03936cde0
|
||||||
|
# Parent a4194a67868fa916074416e96456d07d52b1a1a1
|
||||||
|
Fix: TypeError: 'str' does not support the buffer interface
|
||||||
|
|
||||||
|
Fixes https://bitbucket.org/pypy/pypy/issues/2718
|
||||||
|
|
||||||
|
diff --git a/lib_pypy/pyrepl/unix_console.py b/lib_pypy/pyrepl/unix_console.py
|
||||||
|
--- a/lib_pypy/pyrepl/unix_console.py
|
||||||
|
+++ b/lib_pypy/pyrepl/unix_console.py
|
||||||
|
@@ -500,7 +500,7 @@
|
||||||
|
os.write(self.output_fd, fmt[:x])
|
||||||
|
fmt = fmt[y:]
|
||||||
|
delay = int(m.group(1))
|
||||||
|
- if '*' in m.group(2):
|
||||||
|
+ if b'*' in m.group(2):
|
||||||
|
delay *= self.height
|
||||||
|
if self._pad:
|
||||||
|
nchars = (bps*delay)/1000
|
17
pypy3.spec
17
pypy3.spec
|
@ -1,7 +1,7 @@
|
||||||
Name: pypy3
|
Name: pypy3
|
||||||
Version: 5.10.0
|
Version: 5.10.0
|
||||||
%global pyversion 3.5
|
%global pyversion 3.5
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
Summary: Python 3 implementation with a Just-In-Time compiler
|
Summary: Python 3 implementation with a Just-In-Time compiler
|
||||||
|
|
||||||
# LGPL and another free license we'd need to ask spot about are present in some
|
# LGPL and another free license we'd need to ask spot about are present in some
|
||||||
|
@ -158,6 +158,12 @@ Patch7: 007-remove-startup-message.patch
|
||||||
# It seems ppc64 has no faulthandler
|
# It seems ppc64 has no faulthandler
|
||||||
Patch11: 011-no-faulthandler.patch
|
Patch11: 011-no-faulthandler.patch
|
||||||
|
|
||||||
|
# https://bitbucket.org/pypy/pypy/issues/2717
|
||||||
|
Patch12: 012-time-sleep-i686-overflow.patch
|
||||||
|
|
||||||
|
# https://bitbucket.org/pypy/pypy/issues/2718
|
||||||
|
Patch13: 013-fix-typeerror.patch
|
||||||
|
|
||||||
# Build-time requirements:
|
# Build-time requirements:
|
||||||
|
|
||||||
# pypy's can be rebuilt using itself, rather than with CPython; doing so
|
# pypy's can be rebuilt using itself, rather than with CPython; doing so
|
||||||
|
@ -711,12 +717,6 @@ CheckPyPy() {
|
||||||
# test_multiprocessing, so skip it for now:
|
# test_multiprocessing, so skip it for now:
|
||||||
SkipTest test_multiprocessing
|
SkipTest test_multiprocessing
|
||||||
|
|
||||||
# the timeout tests are hanging on i686
|
|
||||||
# see https://bitbucket.org/pypy/pypy/issues/2717
|
|
||||||
%ifarch %{ix86}
|
|
||||||
SkipTest test_socket
|
|
||||||
%endif
|
|
||||||
|
|
||||||
echo "== Test names =="
|
echo "== Test names =="
|
||||||
cat testnames.txt
|
cat testnames.txt
|
||||||
echo "================="
|
echo "================="
|
||||||
|
@ -835,6 +835,9 @@ CheckPyPy %{name}-stackless
|
||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Thu Dec 28 2017 Miro Hrončok <mhroncok@redhat.com> - 5.10.0-2
|
||||||
|
- Fixed upstream issues #2717 and #2718 (re-enable test_socket)
|
||||||
|
|
||||||
* Mon Dec 25 2017 Miro Hrončok <mhroncok@redhat.com> - 5.10.0-1
|
* Mon Dec 25 2017 Miro Hrončok <mhroncok@redhat.com> - 5.10.0-1
|
||||||
- Update to 5.10 (#1528841)
|
- Update to 5.10 (#1528841)
|
||||||
- Use pypy2 and python2-pycparser (note the twos)
|
- Use pypy2 and python2-pycparser (note the twos)
|
||||||
|
|
Loading…
Reference in New Issue