mirror of
https://github.com/LostRuins/koboldcpp.git
synced 2025-09-10 17:14:36 +00:00
fix sanity check
This commit is contained in:
parent
87cd8e6a00
commit
ca281bd5ba
1 changed files with 2 additions and 3 deletions
|
@ -3647,8 +3647,7 @@ def zenity(filetypes=None, initialdir="", initialfile="", **kwargs) -> Tuple[int
|
|||
.replace("?", "\\?").replace("&", "&").replace("|", "|").replace("<", "<").replace(">", ">")\
|
||||
.replace("(", "\\(").replace(")", "\\)").replace("[", "\\[").replace("]", "\\]").replace("{", "\\{").replace("}", "\\}")
|
||||
|
||||
def zenity_sanity_check(): #make sure zenity is sane
|
||||
nonlocal zenity_bin
|
||||
def zenity_sanity_check(zenity_bin): #make sure zenity is sane
|
||||
try: # Run `zenity --help` and pipe to grep
|
||||
result = subprocess.run(f"{zenity_bin} --help", shell=True, capture_output=True, text=True, encoding='utf-8', timeout=10)
|
||||
if result.returncode == 0 and "Usage" in result.stdout:
|
||||
|
@ -3660,7 +3659,7 @@ def zenity(filetypes=None, initialdir="", initialfile="", **kwargs) -> Tuple[int
|
|||
print(f"Zenity/YAD sanity check failed - {zenity_bin} not found")
|
||||
return False
|
||||
|
||||
if not zenity_sanity_check():
|
||||
if not zenity_sanity_check(zenity_bin):
|
||||
raise Exception("Zenity not working correctly, falling back to TK GUI.")
|
||||
|
||||
# Build args based on keywords
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue