mirror of
https://github.com/AUTOMATIC1111/stable-diffusion-webui.git
synced 2024-12-29 02:45:05 +08:00
launch.py: Don't involve shell for running Python or Git for output
Fixes Linux regression in 451d255b58
This commit is contained in:
parent
1b7e787733
commit
d9968e6108
@ -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
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user