Author: Matti Picus <matti.pi...@gmail.com>
Branch: unicode-utf8-py3
Changeset: r95034:d39037807956
Date: 2018-08-28 06:59 +0200
http://bitbucket.org/pypy/pypy/changeset/d39037807956/

Log:    merge py3.5 into branch

diff --git a/pypy/config/pypyoption.py b/pypy/config/pypyoption.py
--- a/pypy/config/pypyoption.py
+++ b/pypy/config/pypyoption.py
@@ -200,6 +200,10 @@
                default=False,
                requires=[("objspace.usemodules.cpyext", False)]),
 
+    BoolOption("disable_entrypoints_in_cffi",
+               "Disable only cffi's embedding mode.",
+               default=False),
+
     BoolOption("fstrings",
                "if you are really convinced that f-strings are a security "
                "issue, you can disable them here",
diff --git a/pypy/interpreter/pyparser/pyparse.py 
b/pypy/interpreter/pyparser/pyparse.py
--- a/pypy/interpreter/pyparser/pyparse.py
+++ b/pypy/interpreter/pyparser/pyparse.py
@@ -236,7 +236,7 @@
                             next_token_seen is not None and
                             next_token_seen.value != '('):
                         msg = "Missing parentheses in call to '%s'" % (
-                            last_token_seen,)
+                            last_token_seen.value,)
                     else:
                         msg = "invalid syntax"
                     if e.expected_str is not None:
diff --git a/pypy/module/_cffi_backend/__init__.py 
b/pypy/module/_cffi_backend/__init__.py
--- a/pypy/module/_cffi_backend/__init__.py
+++ b/pypy/module/_cffi_backend/__init__.py
@@ -71,7 +71,8 @@
     def __init__(self, space, *args):
         MixedModule.__init__(self, space, *args)
         #
-        if not space.config.objspace.disable_entrypoints:
+        if (not space.config.objspace.disable_entrypoints and
+            not space.config.objspace.disable_entrypoints_in_cffi):
             # import 'embedding', which has the side-effect of registering
             # the 'pypy_init_embedded_cffi_module' entry point
             from pypy.module._cffi_backend import embedding
diff --git a/pypy/module/cpyext/test/test_cpyext.py 
b/pypy/module/cpyext/test/test_cpyext.py
--- a/pypy/module/cpyext/test/test_cpyext.py
+++ b/pypy/module/cpyext/test/test_cpyext.py
@@ -136,10 +136,11 @@
 
 class LeakCheckingTest(object):
     """Base class for all cpyext tests."""
-    spaceconfig = dict(usemodules=['_cffi_backend', 'cpyext', 'thread',
-                                   'struct', 'array', 'itertools', 'time',
-                                   'binascii', 'mmap',
-                                   ])
+    spaceconfig = {"usemodules" : ['cpyext', 'thread', 'struct', 'array',
+                                   'itertools', 'time', 'binascii', 'mmap',
+                                   '_cffi_backend',
+                                   ],
+                   "objspace.disable_entrypoints_in_cffi": True}
 
     @classmethod
     def preload_builtins(cls, space):
@@ -222,7 +223,7 @@
         if not cls.runappdirect:
             cls.sys_info = get_cpyext_info(space)
             cls.w_debug_collect = space.wrap(interp2app(debug_collect))
-            #cls.preload_builtins(space)
+            cls.preload_builtins(space)
         else:
             def w_import_module(self, name, init=None, body='', filename=None,
                     include_dirs=None, PY_SSIZE_T_CLEAN=False):
diff --git a/pypy/module/cpyext/test/test_pyerrors.py 
b/pypy/module/cpyext/test/test_pyerrors.py
--- a/pypy/module/cpyext/test/test_pyerrors.py
+++ b/pypy/module/cpyext/test/test_pyerrors.py
@@ -479,6 +479,7 @@
             ])
         raises(SystemError, module.oops)
 
+    @pytest.mark.skipif("not config.option.runappdirect", reason='-A only')
     def test_error_thread_race(self):
         # Check race condition: thread 0 returns from cpyext with error set,
         # after thread 1 has set an error but before it returns.
_______________________________________________
pypy-commit mailing list
pypy-commit@python.org
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to