py3: fix tweakdefaults on Windows again

Summary: The previous change here wasn't sufficient. We need to wrap the handle fd in a Handle now as well.

Reviewed By: quark-zju, sfilipco

Differential Revision: D27753458

fbshipit-source-id: bd8ebbdcdc9acb411362795263b1419360f15e1a
This commit is contained in:
Durham Goode 2021-04-13 21:16:29 -07:00 committed by Facebook GitHub Bot
parent b6160bbb4a
commit d678e3ac7c

View File

@ -745,12 +745,14 @@ def get_winpopen4(pipei_bufsize):
import _subprocess
handles = _subprocess.CreatePipe(None, pipei_bufsize)
rfd, wfd = [msvcrt.open_osfhandle(h, 0) for h in handles]
else:
import _winapi
handles = _winapi.CreatePipe(None, pipei_bufsize)
rfd, wfd = [msvcrt.open_osfhandle(h, 0) for h in handles]
handles = [subprocess.Handle(h) for h in handles]
rfd, wfd = [msvcrt.open_osfhandle(h, 0) for h in handles]
handles[0].Detach()
handles[1].Detach()
p = subprocess.Popen(