[Python-checkins] r79633 - in python/trunk: Doc/library/os.rst Doc/library/signal.rst Doc/library/subprocess.rst Lib/subprocess.py Lib/test/test_os.py Lib/test/win_console_handler.py Lib/unittest/test/test_break.py Modules/posixmodule.c Modules/signalmodule.c PC/_subprocess.c

Georg Brandl g.brandl at gmx.net
Sat Apr 3 07:48:16 CEST 2010


Am 03.04.2010 01:26, schrieb brian.curtin:

> Modified: python/trunk/Modules/posixmodule.c
> ==============================================================================
> --- python/trunk/Modules/posixmodule.c	(original)
> +++ python/trunk/Modules/posixmodule.c	Sat Apr  3 01:26:06 2010
> @@ -4075,6 +4075,53 @@
>  }
>  #endif
>  
> +#ifdef MS_WINDOWS
> +PyDoc_STRVAR(win32_kill__doc__,
> +"kill(pid, sig)\n\n\
> +Kill a process with a signal.");
> +
> +static PyObject *
> +win32_kill(PyObject *self, PyObject *args)
> +{
> +	PyObject *result, handle_obj;
> +	DWORD pid, sig, err;
> +	HANDLE handle;
> +
> +	if (!PyArg_ParseTuple(args, "kk:kill", &pid, &sig))
> +		return NULL;
> +
> +	/* Console processes which share a common console can be sent CTRL+C or
> +	   CTRL+BREAK events, provided they handle said events. */
> +	if (sig == CTRL_C_EVENT || sig == CTRL_BREAK_EVENT) {
> +		if (GenerateConsoleCtrlEvent(sig, pid) == 0) {
> +			err = GetLastError();
> +			PyErr_SetFromWindowsErr(err);
> +		}
> +		else
> +			Py_RETURN_NONE;
> +	}

Isn't there a return missing in the error case?

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.



More information about the Python-checkins mailing list