[pypy-commit] pypy win32-cleanup2: convert signal_values into dict so in c it will become a set

mattip noreply at buildbot.pypy.org
Mon May 7 20:27:00 CEST 2012


Author: Matti Picus <matti.picus at gmail.com>
Branch: win32-cleanup2
Changeset: r54944:544d0fe29a8a
Date: 2012-05-07 21:26 +0300
http://bitbucket.org/pypy/pypy/changeset/544d0fe29a8a/

Log:	convert signal_values into dict so in c it will become a set

diff --git a/pypy/module/signal/interp_signal.py b/pypy/module/signal/interp_signal.py
--- a/pypy/module/signal/interp_signal.py
+++ b/pypy/module/signal/interp_signal.py
@@ -25,6 +25,9 @@
 SIG_IGN = cpy_signal.SIG_IGN
 signal_names = list(setup())
 signal_values = [globals()[key] for key in signal_names]
+signal_values = {}
+for key in signal_names:
+    signal_values[globals()[key]] = None
 
 includes = ['stdlib.h', 'src/signals.h']
 if sys.platform != 'win32':
@@ -244,7 +247,7 @@
     return space.w_None
 
 def check_signum(space, signum):
-    for sig in signal_values:
+    for sig in signal_values.keys():
         if signum == sig:
             return
     raise OperationError(space.w_ValueError,
diff --git a/pypy/module/signal/test/test_signal.py b/pypy/module/signal/test/test_signal.py
--- a/pypy/module/signal/test/test_signal.py
+++ b/pypy/module/signal/test/test_signal.py
@@ -38,8 +38,6 @@
 class AppTestSignal:
 
     def setup_class(cls):
-        if not hasattr(os, 'kill') or not hasattr(os, 'getpid'):
-            py.test.skip("requires os.kill() and os.getpid()")
         space = gettestobjspace(usemodules=['signal'])
         cls.space = space
         cls.w_signal = space.appexec([], "(): import signal; return signal")


More information about the pypy-commit mailing list