Author: Armin Rigo <[email protected]>
Branch: signal-and-thread
Changeset: r61278:0d35394e8c39
Date: 2013-02-15 17:34 +0000
http://bitbucket.org/pypy/pypy/changeset/0d35394e8c39/
Log: Test and fix
diff --git a/pypy/module/thread/app_signal.py b/pypy/module/thread/app_signal.py
--- a/pypy/module/thread/app_signal.py
+++ b/pypy/module/thread/app_signal.py
@@ -1,4 +1,4 @@
-import __pypy__
+import thread
class SignalsEnabled(object):
'''A context manager to use in non-main threads:
@@ -8,7 +8,7 @@
that is within a "with signals_enabled:". This other thread should be
ready to handle unexpected exceptions that the signal handler might
raise --- notably KeyboardInterrupt.'''
- __enter__ = __pypy__._signals_enter
- __exit__ = __pypy__._signals_exit
+ __enter__ = thread._signals_enter
+ __exit__ = thread._signals_exit
signals_enabled = SignalsEnabled()
diff --git a/pypy/module/thread/test/test_signal.py
b/pypy/module/thread/test/test_signal.py
--- a/pypy/module/thread/test/test_signal.py
+++ b/pypy/module/thread/test/test_signal.py
@@ -1,7 +1,17 @@
import sys
-class AppTest:
+class AppTestMinimal:
+ spaceconfig = dict(usemodules=['thread'])
+
+ def test_signal(self):
+ import thread
+ with thread.signals_enabled:
+ pass
+ # assert did not crash
+
+
+class AppTestThreadSignal:
spaceconfig = dict(usemodules=['thread', 'signal'])
def setup_class(cls):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit