[pypy-commit] pypy py3.5: hg merge default
arigo
pypy.commits at gmail.com
Sat Jun 17 12:33:11 EDT 2017
Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r91622:d7d9692a9f74
Date: 2017-06-17 18:32 +0200
http://bitbucket.org/pypy/pypy/changeset/d7d9692a9f74/
Log: hg merge default
diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -1,6 +1,6 @@
syntax: glob
*.py[co]
-*.sw[po]
+*.sw[pon]
*~
.*.swp
.idea
@@ -10,6 +10,8 @@
.venv
.cache
+.cache/
+.gdb_history
syntax: regexp
^testresult$
^site-packages$
@@ -90,7 +92,6 @@
.hypothesis/
^release/
^rpython/_cache$
-^\.cache$
pypy/module/cppyy/.+/*\.pcm
diff --git a/pypy/doc/build.rst b/pypy/doc/build.rst
--- a/pypy/doc/build.rst
+++ b/pypy/doc/build.rst
@@ -93,7 +93,8 @@
libsqlite3
curses
- libncurses
+ libncurses-dev (for PyPy2)
+ libncursesw-dev (for PyPy3)
gdbm
libgdbm-dev
@@ -106,12 +107,13 @@
To run untranslated tests, you need the Boehm garbage collector libgc.
-On Debian, this is the command to install all build-time dependencies::
+On Debian and Ubuntu, this is the command to install all build-time
+dependencies::
apt-get install gcc make libffi-dev pkg-config libz-dev libbz2-dev \
libsqlite3-dev libncurses-dev libexpat1-dev libssl-dev libgdbm-dev \
tk-dev libgc-dev python-cffi \
- liblzma-dev # For lzma on PyPy3.
+ liblzma-dev libncursesw-dev # these two only needed on PyPy3
On Fedora::
diff --git a/pypy/doc/whatsnew-head.rst b/pypy/doc/whatsnew-head.rst
--- a/pypy/doc/whatsnew-head.rst
+++ b/pypy/doc/whatsnew-head.rst
@@ -9,3 +9,11 @@
.. branch: cffi-char16-char32
The two ``cffi-*`` branches are part of the upgrade to cffi 1.11.
+
+.. branch: ctypes_char_indexing
+
+Indexing into char* behaves differently than CPython
+
+.. branch: vmprof-0.4.8
+
+Improve and fix issues with vmprof
diff --git a/pypy/module/cpyext/setobject.py b/pypy/module/cpyext/setobject.py
--- a/pypy/module/cpyext/setobject.py
+++ b/pypy/module/cpyext/setobject.py
@@ -9,6 +9,7 @@
PySet_Check, PySet_CheckExact = build_type_checkers("Set")
+PyFrozenSet_Check, PyFrozenSet_CheckExact = build_type_checkers("FrozenSet")
@cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
def PyAnySet_Check(space, w_obj):
@@ -91,7 +92,7 @@
"""Return the length of a set or frozenset object. Equivalent to
len(anyset). Raises a PyExc_SystemError if anyset is not a set, frozenset,
or an instance of a subtype."""
- if not PySet_Check(space, ref):
+ if not PyAnySet_Check(space, ref):
raise oefmt(space.w_TypeError, "expected set object")
return PySet_GET_SIZE(space, ref)
@@ -104,3 +105,20 @@
set, frozenset, or an instance of a subtype."""
w_res = space.contains(w_obj, w_key)
return space.int_w(w_res)
+
+ at cpython_api([PyObject], PyObject)
+def PyFrozenSet_New(space, w_iterable):
+ """Return a new frozenset containing objects returned by the iterable.
+ The iterable may be NULL to create a new empty frozenset. Return the new
+ set on success or NULL on failure. Raise TypeError if iterable is
+ not actually iterable.
+
+ Now guaranteed to return a brand-new frozenset. Formerly,
+ frozensets of zero-length were a singleton. This got in the way of
+ building-up new frozensets with PySet_Add()."""
+ if w_iterable is None:
+ return space.call_function(space.w_frozenset)
+ else:
+ return space.call_function(space.w_frozenset, w_iterable)
+
+
diff --git a/pypy/module/cpyext/stubs.py b/pypy/module/cpyext/stubs.py
--- a/pypy/module/cpyext/stubs.py
+++ b/pypy/module/cpyext/stubs.py
@@ -1408,26 +1408,6 @@
equivalent to the Python expression o.count(value)."""
raise NotImplementedError
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
-def PyFrozenSet_Check(space, p):
- """Return true if p is a frozenset object or an instance of a
- subtype."""
- raise NotImplementedError
-
- at cpython_api([PyObject], rffi.INT_real, error=CANNOT_FAIL)
-def PyFrozenSet_CheckExact(space, p):
- """Return true if p is a frozenset object but not an instance of a
- subtype."""
- raise NotImplementedError
-
- at cpython_api([PyObject], PyObject)
-def PyFrozenSet_New(space, iterable):
- """Return a new frozenset containing objects returned by the iterable.
- The iterable may be NULL to create a new empty frozenset. Return the new
- set on success or NULL on failure. Raise TypeError if iterable is
- not actually iterable."""
- raise NotImplementedError
-
@cpython_api([FILE, rffi.CCHARP], rffi.INT_real, error=-1)
def Py_FdIsInteractive(space, fp, filename):
"""Return true (nonzero) if the standard I/O file fp with name filename is
diff --git a/pypy/module/cpyext/test/test_setobject.py b/pypy/module/cpyext/test/test_setobject.py
--- a/pypy/module/cpyext/test/test_setobject.py
+++ b/pypy/module/cpyext/test/test_setobject.py
@@ -9,9 +9,11 @@
class TestTupleObject(BaseApiTest):
def test_setobj(self, space, api):
assert not api.PySet_Check(space.w_None)
+ assert not api.PyFrozenSet_Check(space.w_None)
assert api.PySet_Add(space.w_None, space.w_None) == -1
api.PyErr_Clear()
w_set = space.call_function(space.w_set)
+ assert not api.PyFrozenSet_CheckExact(w_set)
space.call_method(w_set, 'update', space.wrap([1,2,3,4]))
assert api.PySet_Size(w_set) == 4
assert api.PySet_GET_SIZE(w_set) == 4
@@ -21,6 +23,8 @@
def test_set_add_discard(self, space, api):
w_set = api.PySet_New(None)
assert api.PySet_Size(w_set) == 0
+ w_set = api.PyFrozenSet_New(space.wrap([1,2,3,4]))
+ assert api.PySet_Size(w_set) == 4
w_set = api.PySet_New(space.wrap([1,2,3,4]))
assert api.PySet_Size(w_set) == 4
api.PySet_Add(w_set, space.wrap(6))
diff --git a/rpython/jit/backend/x86/assembler.py b/rpython/jit/backend/x86/assembler.py
--- a/rpython/jit/backend/x86/assembler.py
+++ b/rpython/jit/backend/x86/assembler.py
@@ -980,7 +980,8 @@
from rpython.rlib.rvmprof.rvmprof import cintf
# edx = address of pypy_threadlocal_s
self.mc.MOV_rs(edx.value, THREADLOCAL_OFS)
- self.mc.AND_ri(edx.value, ~1)
+ if self._is_asmgcc():
+ self.mc.AND_ri(edx.value, ~1)
# eax = (our local vmprof_tl_stack).next
self.mc.MOV_rs(eax.value, (FRAME_FIXED_SIZE - 4 + 0) * WORD)
# save in vmprof_tl_stack the value eax
diff --git a/rpython/rlib/rstring.py b/rpython/rlib/rstring.py
--- a/rpython/rlib/rstring.py
+++ b/rpython/rlib/rstring.py
@@ -636,7 +636,7 @@
return SomeInteger(nonneg=True)
def method_build(self):
- return SomeString()
+ return SomeString(can_be_None=False)
def rtyper_makerepr(self, rtyper):
from rpython.rtyper.lltypesystem.rbuilder import stringbuilder_repr
@@ -676,7 +676,7 @@
return SomeInteger(nonneg=True)
def method_build(self):
- return SomeUnicodeString()
+ return SomeUnicodeString(can_be_None=False)
def rtyper_makerepr(self, rtyper):
from rpython.rtyper.lltypesystem.rbuilder import unicodebuilder_repr
diff --git a/rpython/translator/platform/__init__.py b/rpython/translator/platform/__init__.py
--- a/rpython/translator/platform/__init__.py
+++ b/rpython/translator/platform/__init__.py
@@ -260,7 +260,8 @@
# Only required on armhf and mips{,el}, not armel. But there's no way to
# detect armhf without shelling out
if (platform.architecture()[0] == '64bit'
- or platform.machine().startswith(('arm', 'mips', 'ppc'))):
+ or platform.machine().startswith(
+ ('arm', 'm68k', 'mips', 'parisc', 'ppc', 'sh4'))):
host_factory = LinuxPIC
else:
host_factory = Linux
More information about the pypy-commit
mailing list