Skip to content

Commit

Permalink
Sandbox Process Creation
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeebot committed Dec 19, 2023
1 parent 1637f88 commit 702927a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ dependencies = [
"click",
"prompt-toolkit",
"questionary~=2.0.0",
"security~=1.2.0",
]

[project.urls]
Expand Down
7 changes: 3 additions & 4 deletions src/pixee/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from ._version import __version__
from .logo import logo2 as logo
from security import safe_command

# Enable overrides for local testing purposes
PYTHON_CODEMODDER = os.environ.get("PIXEE_PYTHON_CODEMODDER", "pixee-python-codemods")
Expand Down Expand Up @@ -159,8 +160,7 @@ def run_codemodder(
f"Applying {num_codemods} {language} codemods",
total=num_codemods,
)
command = subprocess.Popen(
[codemodder, "--output", codetf.name, path] + common_codemodder_args,
command = safe_command.run(subprocess.Popen, [codemodder, "--output", codetf.name, path] + common_codemodder_args,
stderr=subprocess.DEVNULL,
stdout=subprocess.PIPE if not verbose else None,
)
Expand Down Expand Up @@ -427,8 +427,7 @@ def summarize_results(combined_codetf):

@lru_cache()
def list_codemods(codemodder: str):
result = subprocess.run(
[codemodder, "--list"],
result = safe_command.run(subprocess.run, [codemodder, "--list"],
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
check=True,
Expand Down

0 comments on commit 702927a

Please sign in to comment.