Skip to content

Commit

Permalink
convert signal_values into dict so in c it will become a set
Browse files Browse the repository at this point in the history
--HG--
branch : win32-cleanup2
  • Loading branch information
mattip committed May 7, 2012
1 parent 359883c commit fbe94f7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 4 additions & 1 deletion pypy/module/signal/interp_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ def setup():
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':
Expand Down Expand Up @@ -244,7 +247,7 @@ def pause(space):
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,
Expand Down
2 changes: 0 additions & 2 deletions pypy/module/signal/test/test_signal.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ def myhandler(signum, frame):
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")
Expand Down

0 comments on commit fbe94f7

Please sign in to comment.