terminate_process_group: also properly yield iterator when we return early
This commit is contained in:
@@ -179,6 +179,7 @@ def terminate_process_group(process: subprocess.Popen) -> Iterator[None]:
|
|||||||
try:
|
try:
|
||||||
process_group = os.getpgid(process.pid)
|
process_group = os.getpgid(process.pid)
|
||||||
except ProcessLookupError:
|
except ProcessLookupError:
|
||||||
|
yield
|
||||||
return
|
return
|
||||||
if process_group == os.getpgid(os.getpid()):
|
if process_group == os.getpgid(os.getpid()):
|
||||||
msg = "Bug! Refusing to terminate the current process group"
|
msg = "Bug! Refusing to terminate the current process group"
|
||||||
|
|||||||
Reference in New Issue
Block a user