From 7472ff6b374eaed7382ae6016b516b84954c18e3 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Tue, 13 Dec 2022 18:19:17 -0800 Subject: [PATCH] Return early in torbrowser_12_rename_old_tbb() if the TBB path does not exist yet --- torbrowser_launcher/common.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/torbrowser_launcher/common.py b/torbrowser_launcher/common.py index 1b24814e..6623c0cd 100644 --- a/torbrowser_launcher/common.py +++ b/torbrowser_launcher/common.py @@ -177,6 +177,8 @@ def build_paths(self, tbb_version=None): # Tor Browser 12.0 no longer has locales. If an old TBB folder exists with locals, rename it to just tor_browser def torbrowser12_rename_old_tbb(self): + if not os.path.exists(self.paths["tbb"]["dir"]): + return for filename in os.listdir(self.paths["tbb"]["dir"]): abs_filename = os.path.join(self.paths["tbb"]["dir"], filename) if filename.startswith("tor-browser_") and os.path.isdir(abs_filename):