Skip to content

Commit

Permalink
Use spawn instead of fork on windows -> not sure about the implecations.
Browse files Browse the repository at this point in the history
  • Loading branch information
antarcticrainforest committed Jul 22, 2024
1 parent a7027a1 commit 5075dd3
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions pyinstaller/pre-win.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
try:
import ansible

ansible_cli_path = (
Path(ansible.__file__).parent / "cli" / "__init__.py"
)
ansible_cli_path = Path(ansible.__file__).parent / "cli" / "__init__.py"
finally:
sys.getfilesystemencoding = getfilesystemencoding
locale.getlocale = getlocale
Expand All @@ -29,21 +27,12 @@
if f"os.{call}" in content:
write = True
if "import os, termios" not in content:
content = content.replace(
"import os", "import os, termios"
)
content = content.replace("import os", "import os, termios")
content = content.replace(f"os.{call}", f"termios.{call}")
if (
"get_context('fork')" in content
or 'get_context("fork")' in content
):
if "get_context('fork')" in content or 'get_context("fork")' in content:
write = True
content = content.repalce(
"get_context('fork')", "get_context('spawn')"
)
content = content.replace(
'get_context("fork")', 'get_context("spwan")'
)
content = content.replace("get_context('fork')", "get_context('spawn')")
content = content.replace('get_context("fork")', 'get_context("spwan")')
if write:
inp_file.write_text(content, encoding="utf-8")
else:
Expand Down

0 comments on commit 5075dd3

Please sign in to comment.