Skip to content

Commit

Permalink
Merge branch 'dev' into jax
Browse files Browse the repository at this point in the history
  • Loading branch information
Smartappli authored Jun 2, 2024
2 parents 81c8f34 + 0f6f105 commit 0694973
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions packages/syft/src/syft/node/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from pathlib import Path
import shutil
import subprocess # nosec
import sys
import tempfile
from time import sleep
import traceback
Expand Down Expand Up @@ -221,10 +222,17 @@ def in_kubernetes() -> bool:


def get_venv_packages() -> str:
res = subprocess.getoutput(
"pip list --format=freeze", # nosec
)
return res
try:
# subprocess call is safe because it uses a fully qualified path and fixed arguments
result = subprocess.run(
[sys.executable, "-m", "pip", "list", "--format=freeze"], # nosec
capture_output=True,
check=True,
text=True,
)
return result.stdout
except subprocess.CalledProcessError as e:
return f"An error occurred: {e.stderr}"


def get_syft_worker() -> bool:
Expand Down

0 comments on commit 0694973

Please sign in to comment.