From 3c3d7feefe9ce37fa8467c0bfcb7750a4d86b705 Mon Sep 17 00:00:00 2001 From: samith Date: Sat, 4 Jul 2026 22:03:02 +0530 Subject: [PATCH] Update folder_paths.py Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- folder_paths.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/folder_paths.py b/folder_paths.py index f7faf84bd..5cc9f8ecf 100644 --- a/folder_paths.py +++ b/folder_paths.py @@ -30,14 +30,13 @@ def valid_path(saved_path,description = "Instance Folder"): return redirects[description] print(f"\n[!] ALERT: {description} not found at: {saved_path}") new_path= input(f"Please paste the updated absolute path for '{description}': ").strip() - try: - redirects = {} - if os.path.exists(redirects): - with open(redirects, "r") as f: redirects = json.load(f) - redirects[description] = new_path - with open(redirects, "w") as f: json.dump(redirects, f, indent=4) - except Exception: - pass + redirects = {} + if os.path.exists(redirect_path): + with open(redirect_path, "r") as f: + redirects = json.load(f) + redirects[description] = new_path + with open(redirect_path, "w") as f: + json.dump(redirects, f, indent=4) return new_path