Skip to content

Commit

Permalink
FIXUP: store in base isolation_provider the stderr
Browse files Browse the repository at this point in the history
  • Loading branch information
deeplow committed Jan 15, 2024
1 parent 68cdca8 commit 609b77e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
5 changes: 5 additions & 0 deletions dangerzone/isolation_provider/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ def __init__(self) -> None:
self.percentage = 0.0
self.proc: Optional[subprocess.Popen] = None

if getattr(sys, "dangerzone_dev", False) == True:
self.proc_stderr = subprocess.PIPE
else:
self.proc_stderr = subprocess.DEVNULL

@abstractmethod
def install(self) -> bool:
pass
Expand Down
8 changes: 1 addition & 7 deletions dangerzone/isolation_provider/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,11 @@ def exec(
args_str = " ".join(shlex.quote(s) for s in args)
log.info("> " + args_str)

dev_mode = getattr(sys, "dangerzone_dev", False) == True
if dev_mode:
stderr = subprocess.PIPE
else:
stderr = subprocess.DEVNULL

return subprocess.Popen(
args,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=stderr,
stderr=self.proc_stderr,
startupinfo=startupinfo,
)

Expand Down

0 comments on commit 609b77e

Please sign in to comment.