diff options
author | Micah Lee <micah@micahflee.com> | 2021-11-12 17:18:28 -0800 |
---|---|---|
committer | Micah Lee <micah@micahflee.com> | 2021-11-12 17:18:28 -0800 |
commit | be1772b2a4d1b3b73cf88c554f88cea5981127be (patch) | |
tree | dc2701f10a28a0835f727d42ce96277233c1f2c9 /desktop/src | |
parent | 3464a24e698d61d5a4cbf429abd7920aa3bcdde2 (diff) | |
download | onionshare-be1772b2a4d1b3b73cf88c554f88cea5981127be.tar.gz onionshare-be1772b2a4d1b3b73cf88c554f88cea5981127be.zip |
Fix tor paths for flatpak
Diffstat (limited to 'desktop/src')
-rw-r--r-- | desktop/src/onionshare/gui_common.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/desktop/src/onionshare/gui_common.py b/desktop/src/onionshare/gui_common.py index 0d145f11..af755401 100644 --- a/desktop/src/onionshare/gui_common.py +++ b/desktop/src/onionshare/gui_common.py @@ -412,7 +412,7 @@ class GuiCommon: def get_tor_paths(self): if self.common.platform == "Linux": base_path = self.get_resource_path("tor") - if os.path.exists(base_path): + if base_path: self.common.log( "GuiCommon", "get_tor_paths", "using paths in resources" ) @@ -471,7 +471,10 @@ class GuiCommon: """ Returns the absolute path of a resource """ - return resource_filename("onionshare", os.path.join("resources", filename)) + try: + return resource_filename("onionshare", os.path.join("resources", filename)) + except KeyError: + return None @staticmethod def get_translated_tor_error(e): |