CIS BUGHUNT - python on windows

- handle when external program exists faster on spawn before control is returned to python script

tested on pre-flight: https://ec-01.epicgames.net/commander/link/jobDetails/jobs/9372908

#jira UE-76599  //UE4/Release-4.23 - Compile UE4Game HTML5 - clang++.exe --version failed: [Error 5] Access is denied
#rb none
#rnx

#ROBOMERGE-OWNER: ryan.gerleve
#ROBOMERGE-AUTHOR: nick.shin
#ROBOMERGE-SOURCE: CL 7428128 in //UE4/Release-4.23/... via CL 7428157
#ROBOMERGE-BOT: ENGINE (Main -> Dev-Networking) (v372-7473910)

[CL 7506956 by nick shin in Dev-Networking branch]
This commit is contained in:
nick shin
2019-07-22 22:21:43 -04:00
2 changed files with 16 additions and 8 deletions

View File

@@ -658,6 +658,7 @@ class Popen(object):
if e.winerror != 5:
print('NICKNICK: subprocess.py e.winerror:', e.winerror)
raise WindowsError(*e.args)
hp = None
# EPIC EDIT end -- nick.shin 2019-06-21 -- UE-76599
finally:
# Child is launched. Close the parent's copy of those pipe
@@ -674,10 +675,13 @@ class Popen(object):
_close_in_parent(errwrite)
# Retain the process handle, but close the thread handle
self._child_created = True
self._handle = hp
self.pid = pid
ht.Close()
# EPIC EDIT start -- nick.shin 2019-07-16 -- UE-76599
if hp is not None:
self._child_created = True
self._handle = hp
self.pid = pid
ht.Close()
# EPIC EDIT end -- nick.shin 2019-07-16 -- UE-76599
def _internal_poll(self, _deadstate=None,
_WaitForSingleObject=_subprocess.WaitForSingleObject,

View File

@@ -658,6 +658,7 @@ class Popen(object):
if e.winerror != 5:
print('NICKNICK: subprocess.py e.winerror:', e.winerror)
raise WindowsError(*e.args)
hp = None
# EPIC EDIT end -- nick.shin 2019-06-13 -- UE-76599
finally:
# Child is launched. Close the parent's copy of those pipe
@@ -674,10 +675,13 @@ class Popen(object):
_close_in_parent(errwrite)
# Retain the process handle, but close the thread handle
self._child_created = True
self._handle = hp
self.pid = pid
ht.Close()
# EPIC EDIT start -- nick.shin 2019-07-16 -- UE-76599
if hp is not None:
self._child_created = True
self._handle = hp
self.pid = pid
ht.Close()
# EPIC EDIT end -- nick.shin 2019-07-16 -- UE-76599
def _internal_poll(self, _deadstate=None,
_WaitForSingleObject=_subprocess.WaitForSingleObject,