Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
group kill is not available on windows, raise the same error as JRuby
  • Loading branch information
timfel committed Jul 19, 2013
1 parent 7b5b462 commit 975724f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions topaz/modules/process.py
@@ -1,12 +1,13 @@
from __future__ import absolute_import

import errno
import os

from topaz.gateway import Coerce
from topaz.module import ModuleDef
from topaz.modules.signal import SIGNALS
from topaz.system import IS_WINDOWS
from topaz.error import error_for_oserror
from topaz.error import error_for_oserror, error_for_errno


if IS_WINDOWS:
Expand All @@ -17,11 +18,15 @@ def geteuid():
def fork():
raise NotImplementedError("fork on windows")

def killpg(pid, sigs):
raise error_for_errno(errno.EINVAL)

def WEXITSTATUS(status):
return status
else:
geteuid = os.geteuid
fork = os.fork
killpg = os.killpg
WEXITSTATUS = os.WEXITSTATUS


Expand Down Expand Up @@ -94,7 +99,7 @@ def method_kill(self, space, w_signal, args_w):
for w_arg in args_w:
pid = space.int_w(w_arg)
try:
os.killpg(pid, -sig)
killpg(pid, -sig)
except OSError as e:
raise error_for_oserror(space, e)
else:
Expand Down

0 comments on commit 975724f

Please sign in to comment.