mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Include the fix from the PyInstaller hook on our hook.
Since we're potentially overriding it. Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
3e298a5e76
commit
26f46218c4
1 changed files with 14 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
"""
|
||||
This package contains the runtime hooks support code for when Salt is pacakged with PyInstaller.
|
||||
"""
|
||||
import io
|
||||
import logging
|
||||
import os
|
||||
import subprocess
|
||||
|
@ -63,6 +64,19 @@ class PyinstallerPopen(subprocess.Popen):
|
|||
kwargs["env"] = clean_pyinstaller_vars(kwargs.pop("env", None))
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
# From https://github.com/pyinstaller/pyinstaller/blob/v5.1/PyInstaller/hooks/rthooks/pyi_rth_subprocess.py
|
||||
#
|
||||
# In windowed mode, force any unused pipes (stdin, stdout and stderr) to be DEVNULL instead of inheriting the
|
||||
# invalid corresponding handles from this parent process.
|
||||
if sys.platform == "win32" and not isinstance(sys.stdout, io.IOBase):
|
||||
|
||||
def _get_handles(self, stdin, stdout, stderr):
|
||||
stdin, stdout, stderr = (
|
||||
subprocess.DEVNULL if pipe is None else pipe
|
||||
for pipe in (stdin, stdout, stderr)
|
||||
)
|
||||
return super()._get_handles(stdin, stdout, stderr)
|
||||
|
||||
|
||||
class PyinstallerTerminal(salt.utils.vt.Terminal): # pylint: disable=abstract-method
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
|
Loading…
Add table
Reference in a new issue