mirror of
https://github.com/freedomofpress/dangerzone.git
synced 2025-04-28 18:02:38 +02:00
Remove pipes module and use shlex instead
Thanks: https://github.com/tox-dev/tox/pull/2418/files Closes #373
This commit is contained in:
parent
47b337143c
commit
494f498d17
2 changed files with 4 additions and 5 deletions
|
@ -1,6 +1,5 @@
|
|||
import logging
|
||||
import os
|
||||
import pipes
|
||||
import platform
|
||||
import shlex
|
||||
import subprocess
|
||||
|
@ -68,7 +67,7 @@ class DangerzoneGui(DangerzoneCore):
|
|||
args = ["open", "-a", "Preview.app", filename]
|
||||
|
||||
# Run
|
||||
args_str = " ".join(pipes.quote(s) for s in args)
|
||||
args_str = " ".join(shlex.quote(s) for s in args)
|
||||
log.info(Fore.YELLOW + "> " + Fore.CYAN + args_str)
|
||||
subprocess.run(args)
|
||||
|
||||
|
@ -89,7 +88,7 @@ class DangerzoneGui(DangerzoneCore):
|
|||
args[i] = filename
|
||||
|
||||
# Open as a background process
|
||||
args_str = " ".join(pipes.quote(s) for s in args)
|
||||
args_str = " ".join(shlex.quote(s) for s in args)
|
||||
log.info(Fore.YELLOW + "> " + Fore.CYAN + args_str)
|
||||
subprocess.Popen(args)
|
||||
|
||||
|
|
|
@ -3,8 +3,8 @@ import json
|
|||
import logging
|
||||
import os
|
||||
import pathlib
|
||||
import pipes
|
||||
import platform
|
||||
import shlex
|
||||
import shutil
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
@ -152,7 +152,7 @@ class Container(IsolationProvider):
|
|||
document: Document,
|
||||
args: List[str],
|
||||
) -> int:
|
||||
args_str = " ".join(pipes.quote(s) for s in args)
|
||||
args_str = " ".join(shlex.quote(s) for s in args)
|
||||
log.info("> " + args_str)
|
||||
|
||||
with subprocess.Popen(
|
||||
|
|
Loading…
Reference in a new issue