Skip to content

Commit

Permalink
Avoid start_new_session if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
niklasf committed Aug 6, 2023
1 parent 90eeeb0 commit 35b961c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion chess/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,11 @@ async def popen(cls: Type[ProtocolT], command: Union[str, List[str]], *, setpgrp
popen_args["creationflags"] = popen_args.get("creationflags", 0) | subprocess.CREATE_NEW_PROCESS_GROUP # type: ignore
except AttributeError:
# Unix.
popen_args["start_new_session"] = True
if sys.version_info >= (3, 11):
popen_args["process_group"] = 0
else:
# Before Python 3.11
popen_args["start_new_session"] = True

return await asyncio.get_running_loop().subprocess_exec(cls, *command, **popen_args)

Expand Down

0 comments on commit 35b961c

Please sign in to comment.