[Python-Dev] About SSL tests

"Martin v. Löwis" martin at v.loewis.de
Wed Apr 4 07:06:37 CEST 2007


> I don't like the idea of rely on the private _handle and do:
> 
>   process = subprocess.Popen(...)
>   ...
>   subprocess.TerminateProcess(int(process._handle), -1)
> 
> so, I'll end doing this:
> 
>   process = subprocess.Popen(...)
>   ...
>   handle =ctypes.windll.kernel32.OpenProcess(1, False, process.pid)
>   ctypes.windll.kernel32.TerminateProcess(handle, -1)
>   ctypes.windll.kernel32.CloseHandle(handle)
> 
> Is this ok?

I don't like it. I would rather rely on the private _handle member.
If that ever gets changed, the test fails.

Regards,
Martin


More information about the Python-Dev mailing list