Author: Matti Picus <[email protected]>
Branch: py3.6
Changeset: r97881:50cb48b9e6e5
Date: 2019-10-29 13:36 +0200
http://bitbucket.org/pypy/pypy/changeset/50cb48b9e6e5/
Log: merge default into branch
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
@@ -16,3 +16,7 @@
.. branch: license-update
Update list directories in LICENSE
+
+.. branch: allow-forcing-no-embed
+
+When packaging, allow suppressing embedded dependencies via
PYPY_NO_EMBED_DEPENDENCIES
diff --git a/pypy/interpreter/test/test_appinterp.py
b/pypy/interpreter/test/test_appinterp.py
--- a/pypy/interpreter/test/test_appinterp.py
+++ b/pypy/interpreter/test/test_appinterp.py
@@ -158,25 +158,3 @@
w_str = space1.getattr(w_mymod1, space1.wrap("hi"))
assert space1.text_w(w_str) == "hello"
-class TestMixedModuleUnfreeze:
- spaceconfig = dict(usemodules=('_socket',))
-
- def test_random_stuff_can_unfreeze(self):
- # When a module contains an "import" statement in applevel code, the
- # imported module is initialized, possibly after it has been already
- # frozen.
-
- # This is important when the module startup() function does something
- # at runtime, like setting os.environ (posix module) or initializing
- # the winsock library (_socket module)
- w_socket = self.space.builtin_modules['_socket']
- # _ssl is not builtin anymore, this test also tried to _cleanup_ on
- # the wrapped ssl object
- # w_ssl = self.space.builtin_modules['_ssl']
-
- # Uncomment this line for a workaround
- # space.getattr(w_ssl, space.wrap('SSLError'))
-
- w_socket._cleanup_()
- assert w_socket.startup_called == False
-
diff --git a/pypy/module/_demo/app_demo.py b/pypy/module/_demo/app_demo.py
--- a/pypy/module/_demo/app_demo.py
+++ b/pypy/module/_demo/app_demo.py
@@ -1,3 +1,8 @@
+# import posix underneath
+from os import environ
+
+# for the test_random_stuff_can_unfreeze test
+environ['PYPY_DEMO_MODULE_ERROR'] = '1'
class DemoError(Exception):
pass
diff --git a/pypy/module/_demo/test/test_import.py
b/pypy/module/_demo/test/test_import.py
--- a/pypy/module/_demo/test/test_import.py
+++ b/pypy/module/_demo/test/test_import.py
@@ -28,3 +28,23 @@
assert Module.demo_events == ['setup', 'startup']
assert space.getattr(w_demo, space.wrap('measuretime'))
+
+class TestMixedModuleUnfreeze:
+ spaceconfig = dict(usemodules=('_demo', 'posix'))
+
+ def test_random_stuff_can_unfreeze(self):
+ # When a module contains an "import" statement in applevel code, the
+ # imported module is initialized, possibly after it has been already
+ # frozen.
+
+ # This is important when the module startup() function does something
+ # at runtime, like setting os.environ (posix module) or initializing
+ # the winsock library (_socket module)
+ w_posix = self.space.builtin_modules['posix']
+ w_demo = self.space.builtin_modules['_demo']
+
+ w_posix._cleanup_()
+ assert w_posix.startup_called == False
+ w_demo._cleanup_() # w_demo.appleveldefs['DemoError'] imports posix
+ assert w_posix.startup_called == False
+
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit