Skip to content

Commit ca281bd

Browse files
committed
fix sanity check
1 parent 87cd8e6 commit ca281bd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

koboldcpp.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3647,8 +3647,7 @@ def zenity_clean(txt: str):
36473647
.replace("?", "\\?").replace("&", "&amp;").replace("|", "&#124;").replace("<", "&lt;").replace(">", "&gt;")\
36483648
.replace("(", "\\(").replace(")", "\\)").replace("[", "\\[").replace("]", "\\]").replace("{", "\\{").replace("}", "\\}")
36493649

3650-
def zenity_sanity_check(): #make sure zenity is sane
3651-
nonlocal zenity_bin
3650+
def zenity_sanity_check(zenity_bin): #make sure zenity is sane
36523651
try: # Run `zenity --help` and pipe to grep
36533652
result = subprocess.run(f"{zenity_bin} --help", shell=True, capture_output=True, text=True, encoding='utf-8', timeout=10)
36543653
if result.returncode == 0 and "Usage" in result.stdout:
@@ -3660,7 +3659,7 @@ def zenity_sanity_check(): #make sure zenity is sane
36603659
print(f"Zenity/YAD sanity check failed - {zenity_bin} not found")
36613660
return False
36623661

3663-
if not zenity_sanity_check():
3662+
if not zenity_sanity_check(zenity_bin):
36643663
raise Exception("Zenity not working correctly, falling back to TK GUI.")
36653664

36663665
# Build args based on keywords

0 commit comments

Comments
 (0)