diff --git a/lbrynet/lbrynet_downloader_gui/DownloaderApp.py b/lbrynet/lbrynet_downloader_gui/DownloaderApp.py index fefb51510..e229bd513 100644 --- a/lbrynet/lbrynet_downloader_gui/DownloaderApp.py +++ b/lbrynet/lbrynet_downloader_gui/DownloaderApp.py @@ -107,11 +107,11 @@ class DownloaderApp(object): self.frame.grid(padx=20, pady=20) logo_file_name = "lbry-dark-242x80.gif" - try: - logo_file = os.path.join(os.path.dirname(__file__), logo_file_name) - except NameError: + if os.name == "nt": logo_file = os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), "lbrynet", "lbrynet_downloader_gui", logo_file_name) + else: + logo_file = os.path.join(os.path.dirname(__file__), logo_file_name) self.logo_picture = tk.PhotoImage(file=logo_file) @@ -138,11 +138,11 @@ class DownloaderApp(object): self.wallet_balance.grid(row=0, column=0) dropdown_file_name = "drop_down.gif" - try: - dropdown_file = os.path.join(os.path.dirname(__file__), dropdown_file_name) - except NameError: + if os.name == "nt": dropdown_file = os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), "lbrynet", "lbrynet_downloader_gui", dropdown_file_name) + else: + dropdown_file = os.path.join(os.path.dirname(__file__), dropdown_file_name) self.dropdown_picture = tk.PhotoImage( file=dropdown_file diff --git a/lbrynet/lbrynet_downloader_gui/StreamFrame.py b/lbrynet/lbrynet_downloader_gui/StreamFrame.py index ea9ec969e..afeb1612f 100644 --- a/lbrynet/lbrynet_downloader_gui/StreamFrame.py +++ b/lbrynet/lbrynet_downloader_gui/StreamFrame.py @@ -31,11 +31,11 @@ class StreamFrame(object): self.button_cursor = "hand1" close_file_name = "close2.gif" - try: - close_file = os.path.join(os.path.dirname(__file__), close_file_name) - except NameError: + if os.name == "nt": close_file = os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), "lbrynet", "lbrynet_downloader_gui", close_file_name) + else: + close_file = os.path.join(os.path.dirname(__file__), close_file_name) self.close_picture = tk.PhotoImage( file=close_file @@ -69,26 +69,26 @@ class StreamFrame(object): self.outer_button_frame.grid(sticky=tk.W + tk.E, row=4) show_options_picture_file_name = "show_options.gif" - try: - show_options_picture_file = os.path.join(os.path.dirname(__file__), - show_options_picture_file_name) - except NameError: + if os.name == "nt": show_options_picture_file = os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), "lbrynet", "lbrynet_downloader_gui", show_options_picture_file_name) + else: + show_options_picture_file = os.path.join(os.path.dirname(__file__), + show_options_picture_file_name) self.show_options_picture = tk.PhotoImage( file=show_options_picture_file ) hide_options_picture_file_name = "hide_options.gif" - try: - hide_options_picture_file = os.path.join(os.path.dirname(__file__), - hide_options_picture_file_name) - except NameError: + if os.name == "nt": hide_options_picture_file = os.path.join(os.path.dirname(os.path.abspath(sys.argv[0])), "lbrynet", "lbrynet_downloader_gui", hide_options_picture_file_name) + else: + hide_options_picture_file = os.path.join(os.path.dirname(__file__), + hide_options_picture_file_name) self.hide_options_picture = tk.PhotoImage( file=hide_options_picture_file