Skip to content

Commit

Permalink
Fix stdin, stdout issue with logger in Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
t3eHawk committed Dec 21, 2022
1 parent a7caff3 commit 6c7628d
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions pydin/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,13 @@ def to_process(exe, path=None, args=None, env=None, devnull=False, spawn=True):
command.extend(args)
kwargs = {}
kwargs['env'] = env
kwargs['stdin'] = sp.DEVNULL if devnull else sp.PIPE
kwargs['stdout'] = sp.DEVNULL if devnull else sp.PIPE
kwargs['stderr'] = sp.DEVNULL if devnull else sp.PIPE
if WINDOWS and spawn:
kwargs['creationflags'] = sp.CREATE_NO_WINDOW
if LINUX or MACOS:
kwargs['stdin'] = sp.DEVNULL if devnull else sp.PIPE
kwargs['stdout'] = sp.DEVNULL if devnull else sp.PIPE
kwargs['stderr'] = sp.DEVNULL if devnull else sp.PIPE
elif WINDOWS:
if spawn:
kwargs['creationflags'] = sp.CREATE_NO_WINDOW
proc = sp.Popen(command, **kwargs)
return proc

Expand Down

0 comments on commit 6c7628d

Please sign in to comment.