aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAUTOMATIC1111 <16777216c@gmail.com>2023-05-14 18:18:09 +0000
committerGitHub <noreply@github.com>2023-05-14 18:18:09 +0000
commitd7d378eda1349d05e999c4c0b4564857ac7c49f2 (patch)
tree7833771102fe396c9ba8aa3122be8f88677dd4ed
parent1b7e7877330519cf2fb1760da6afc81e9f4624e9 (diff)
parentd9968e61082fb5ed16eedfe8fa43bf6f2e7b76e7 (diff)
downloadstable-diffusion-webui-gfx803-d7d378eda1349d05e999c4c0b4564857ac7c49f2.tar.gz
stable-diffusion-webui-gfx803-d7d378eda1349d05e999c4c0b4564857ac7c49f2.tar.bz2
stable-diffusion-webui-gfx803-d7d378eda1349d05e999c4c0b4564857ac7c49f2.zip
Merge pull request #10384 from akx/no-shell
launch.py: Don't involve shell for running Python or getting Git output
-rw-r--r--launch.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/launch.py b/launch.py
index 578af229..f8380911 100644
--- a/launch.py
+++ b/launch.py
@@ -58,7 +58,7 @@ Use --skip-python-version-check to suppress this warning.
@lru_cache()
def commit_hash():
try:
- return subprocess.check_output(f"{git} rev-parse HEAD", encoding='utf8').strip()
+ return subprocess.check_output([git, "rev-parse", "HEAD"], shell=False, encoding='utf8').strip()
except Exception:
return "<none>"
@@ -66,7 +66,7 @@ def commit_hash():
@lru_cache()
def git_tag():
try:
- return subprocess.check_output(f"{git} describe --tags", encoding='utf8').strip()
+ return subprocess.check_output([git, "describe", "--tags"], shell=False, encoding='utf8').strip()
except Exception:
return "<none>"
@@ -125,7 +125,7 @@ def run_pip(command, desc=None, live=default_command_live):
def check_run_python(code: str) -> bool:
- result = subprocess.run([python, "-c", code], capture_output=True, shell=True)
+ result = subprocess.run([python, "-c", code], capture_output=True, shell=False)
return result.returncode == 0