Index: Doc/lib/libos.tex =================================================================== RCS file: /cvsroot/python/python/dist/src/Doc/lib/libos.tex,v retrieving revision 1.162 diff -u -r1.162 libos.tex --- Doc/lib/libos.tex 27 Jun 2005 23:23:43 -0000 1.162 +++ Doc/lib/libos.tex 11 Jul 2005 16:28:41 -0000 @@ -1461,8 +1461,9 @@ \index{process!signalling} Kill the process \var{pid} with signal \var{sig}. Constants for the specific signals available on the host platform are defined in the -\refmodule{signal} module. -Availability: Macintosh, \UNIX. +\refmodule{signal} module. On Windows \code{TerminateProcess} is called and +\var(sig) will be the return code of the terminated process. +Availability: Macintosh, \UNIX, Windows. \end{funcdesc} \begin{funcdesc}{killpg}{pgid, sig} Index: Modules/posixmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/posixmodule.c,v retrieving revision 2.337 diff -u -r2.337 posixmodule.c --- Modules/posixmodule.c 5 Jul 2005 15:21:58 -0000 2.337 +++ Modules/posixmodule.c 11 Jul 2005 16:24:25 -0000 @@ -104,6 +104,7 @@ #define HAVE_SYSTEM 1 #define HAVE_CWAIT 1 #define HAVE_FSYNC 1 +#define HAVE_KILL 1 #define fsync _commit #else #if defined(PYOS_OS2) && defined(PYCC_GCC) || defined(__VMS) @@ -3190,6 +3191,12 @@ int pid, sig; if (!PyArg_ParseTuple(args, "ii:kill", &pid, &sig)) return NULL; + +#if defined(MS_WINDOWS) + if (!TerminateProcess((HANDLE)pid, (UINT)sig)) { + return posix_error(); + } +#else /* defined(MS_WINDOWS) */ #if defined(PYOS_OS2) && !defined(PYCC_GCC) if (sig == XCPT_SIGNAL_INTR || sig == XCPT_SIGNAL_BREAK) { APIRET rc; @@ -3203,14 +3210,15 @@ } else return NULL; /* Unrecognized Signal Requested */ -#else +#else /* defined(PYOS_OS2) && !defined(PYCC_GCC) */ if (kill(pid, sig) == -1) return posix_error(); -#endif +#endif /* defined(PYOS_OS2) && !defined(PYCC_GCC) */ +#endif /* defined(MS_WINDOWS) */ Py_INCREF(Py_None); return Py_None; } -#endif +#endif /* HAVE_KILL */ #ifdef HAVE_KILLPG PyDoc_STRVAR(posix_killpg__doc__,