2.0-0.1.b1

This commit is contained in:
David Malcolm 2012-12-13 06:16:11 -05:00
parent cd9f89c255
commit 8e0c0345a5
4 changed files with 15 additions and 60 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@
/release-1.7.tar.bz2
/release-1.8.tar.bz2
/release-1.9.tar.bz2
/release-2.0-beta-1.tar.bz2

View File

@ -1,48 +0,0 @@
diff --git a/pypy/module/cpyext/intobject.py b/pypy/module/cpyext/intobject.py
--- a/pypy/module/cpyext/intobject.py
+++ b/pypy/module/cpyext/intobject.py
@@ -6,7 +6,7 @@
PyObject, PyObjectFields, CONST_STRING, CANNOT_FAIL, Py_ssize_t)
from pypy.module.cpyext.pyobject import (
make_typedescr, track_reference, RefcountState, from_ref)
-from pypy.rlib.rarithmetic import r_uint, intmask, LONG_TEST
+from pypy.rlib.rarithmetic import r_uint, intmask, LONG_TEST, r_ulonglong
from pypy.objspace.std.intobject import W_IntObject
import sys
@@ -83,6 +83,20 @@
num = space.bigint_w(w_int)
return num.uintmask()
+@cpython_api([PyObject], rffi.ULONGLONG, error=-1)
+def PyInt_AsUnsignedLongLongMask(space, w_obj):
+ """Will first attempt to cast the object to a PyIntObject or
+ PyLongObject, if it is not already one, and then return its value as
+ unsigned long long, without checking for overflow.
+ """
+ w_int = space.int(w_obj)
+ if space.is_true(space.isinstance(w_int, space.w_int)):
+ num = space.int_w(w_int)
+ return r_ulonglong(num)
+ else:
+ num = space.bigint_w(w_int)
+ return num.ulonglongmask()
+
@cpython_api([PyObject], lltype.Signed, error=CANNOT_FAIL)
def PyInt_AS_LONG(space, w_int):
"""Return the value of the object w_int. No error checking is performed."""
diff --git a/pypy/module/cpyext/test/test_intobject.py b/pypy/module/cpyext/test/test_intobject.py
--- a/pypy/module/cpyext/test/test_intobject.py
+++ b/pypy/module/cpyext/test/test_intobject.py
@@ -34,6 +34,11 @@
assert (api.PyInt_AsUnsignedLongMask(space.wrap(10**30))
== 10**30 % ((sys.maxint + 1) * 2))
+ assert (api.PyInt_AsUnsignedLongLongMask(space.wrap(sys.maxint))
+ == sys.maxint)
+ assert (api.PyInt_AsUnsignedLongLongMask(space.wrap(10**30))
+ == 10**30 % (2**64))
+
def test_coerce(self, space, api):
class Coerce(object):
def __int__(self):

View File

@ -1,6 +1,8 @@
%global alphatag b1
Name: pypy
Version: 1.9
Release: 4%{?dist}
Version: 2.0
Release: 0.1.%{alphatag}%{?dist}
Summary: Python implementation with a Just-In-Time compiler
Group: Development/Languages
@ -130,7 +132,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
# Source and patches:
Source0: https://bitbucket.org/pypy/pypy/get/release-%{version}.tar.bz2
Source0: https://bitbucket.org/pypy/pypy/get/release-2.0-beta-1.tar.bz2
# Supply various useful RPM macros for building python modules against pypy:
# __pypy, pypy_sitelib, pypy_sitearch
@ -191,12 +193,6 @@ Patch7: 007-remove-startup-message.patch
Patch8: 008-fix-dynamic-symbols-script.patch
# Cherrypick upstream patch to add PyInt_AsUnsignedLongLongMask (used by
# the rpm python bindings); see https://bugs.pypy.org/issue1211
# This is https://bitbucket.org/pypy/pypy/changeset/542d481517d3
Patch9: 009-add-PyInt_AsUnsignedLongLongMask.patch
# Build-time requirements:
# pypy's can be rebuilt using itself, rather than with CPython; doing so
@ -353,7 +349,7 @@ Build of PyPy with support for micro-threads for massive concurrency
%prep
%setup -q -n pypy-pypy-341e1e3821ff
%setup -q -n pypy-pypy-07e08e9c885c
%patch0 -p1 -b .configure-fedora
%patch1 -p1 -b .suppress-mandelbrot-set-during-tty-build
@ -394,7 +390,6 @@ Build of PyPy with support for micro-threads for massive concurrency
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
# Replace /usr/local/bin/python shebangs with /usr/bin/python:
@ -631,6 +626,10 @@ cp -a lib_pypy %{buildroot}/%{pypyprefix}
# Remove a text file that documents which selftests fail on Win32:
rm %{buildroot}/%{pypyprefix}/lib-python/win32-failures.txt
# Remove a text file containing upstream's recipe for syncing stdlib in
# their hg repository with cpython's:
rm %{buildroot}/%{pypyprefix}/lib-python/stdlib-upgrade.txt
# Remove shebang lines from .py files that aren't executable, and
# remove executability from .py files that don't have a shebang line:
find \
@ -944,6 +943,9 @@ rm -rf $RPM_BUILD_ROOT
%changelog
* Tue Dec 11 2012 David Malcolm <dmalcolm@redhat.com> - 2.0-0.1.b1
- 2.0b1 (drop upstreamed patch 9)
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.9-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

View File

@ -1 +1 @@
f92c0171a9578a3e4a0f74947ec596ab release-1.9.tar.bz2
4a346df59983e4a5c50e8ee211f80619 release-2.0-beta-1.tar.bz2