python windows 下 pp模块 ‘TASKKILL'不是内部或外部命令,也不是可运行的程序或批处理文件 的解决方案

https://www.parallelpython.com/component/option,com_smf/Itemid,1/topic,786.0

Hi,

Just a brief note.  PP works well with pypy (on Windows), however on shutdown, you get (harmless) failure messages from the invocation of 'TASKKILL' in pp.py line 823 (version 1.6.5) due to the child processes already being dead and absent at the time when the TASKKILL is called.  This does not occur using normal CPython and I've not investigated why this is different between CPython and PyPy. 

Nonetheless, since it is harmless, and the child processes are already gone, I'd like to suggest that the TASKKILL line is modified as follows to suppress the spurious error output:

pp.py version 1.6.5 line 823, change from:
                    os.popen('TASKKILL /PID '+str(worker.pid)+' /F')
to
                    os.popen('TASKKILL /PID '+str(worker.pid)+' /F 2>NUL')

Regards,

Walter

我的位置是line 873

你可能感兴趣的:(python,经验总结)