[pypy-commit] pypy py3.5: Add _testcapi.raise_signal(). Hack to have it (and awaitType) correctly
arigo
pypy.commits at gmail.com
Sun Jan 8 11:58:16 EST 2017
Author: Armin Rigo <arigo at tunes.org>
Branch: py3.5
Changeset: r89428:69efed9f9864
Date: 2017-01-08 17:57 +0100
http://bitbucket.org/pypy/pypy/changeset/69efed9f9864/
Log: Add _testcapi.raise_signal(). Hack to have it (and awaitType)
correctly present even if cpyext is enabled.
diff --git a/lib_pypy/_testcapi.py b/lib_pypy/_testcapi.py
--- a/lib_pypy/_testcapi.py
+++ b/lib_pypy/_testcapi.py
@@ -25,3 +25,14 @@
self._iterator = iterator
def __await__(self):
return self._iterator
+
+def raise_signal(signum):
+ import _signal, _thread
+ _signal.pthread_kill(_thread.get_ident(), signum)
+
+
+# the hacks above have replaced this module with another, so we need
+# to push the extra names into this other module too...
+import _testcapi
+_testcapi.awaitType = awaitType
+_testcapi.raise_signal = raise_signal
More information about the pypy-commit
mailing list