diff --git a/cartridges/details_window.py b/cartridges/details_window.py index fb8d26c..3afcb60 100644 --- a/cartridges/details_window.py +++ b/cartridges/details_window.py @@ -286,7 +286,7 @@ class DetailsWindow(Adw.Window): def set_cover(self, _source: Any, result: Gio.Task, *_args: Any) -> None: try: path = self.image_file_dialog.open_finish(result).get_path() - except GLib.GError: + except GLib.Error: return def thread_func() -> None: @@ -319,7 +319,7 @@ class DetailsWindow(Adw.Window): def set_executable(self, _source: Any, result: Gio.Task, *_args: Any) -> None: try: path = self.exec_file_dialog.open_finish(result).get_path() - except GLib.GError: + except GLib.Error: return self.executable.set_text(shlex.quote(path)) diff --git a/cartridges/importer/desktop_source.py b/cartridges/importer/desktop_source.py index 1866b27..1d1f32c 100644 --- a/cartridges/importer/desktop_source.py +++ b/cartridges/importer/desktop_source.py @@ -93,7 +93,7 @@ class DesktopSourceIterable(SourceIterable): executable = keyfile.get_string("Desktop Entry", "Exec").split( " %" )[0] - except GLib.GError: + except GLib.Error: continue try: @@ -101,7 +101,7 @@ class DesktopSourceIterable(SourceIterable): if not self.check_command(try_exec): continue - except GLib.GError: + except GLib.Error: pass # Skip Steam games @@ -119,13 +119,13 @@ class DesktopSourceIterable(SourceIterable): try: if keyfile.get_boolean("Desktop Entry", "NoDisplay"): continue - except GLib.GError: + except GLib.Error: pass try: if keyfile.get_boolean("Desktop Entry", "Hidden"): continue - except GLib.GError: + except GLib.Error: pass # Strip /run/host from Flatpak paths @@ -147,7 +147,7 @@ class DesktopSourceIterable(SourceIterable): try: icon_str = keyfile.get_string("Desktop Entry", "Icon") - except GLib.GError: + except GLib.Error: yield game continue else: @@ -170,7 +170,7 @@ class DesktopSourceIterable(SourceIterable): .get_path() ): additional_data = {"local_icon_path": Path(icon_path)} - except GLib.GError: + except GLib.Error: pass yield (game, additional_data) diff --git a/cartridges/importer/flatpak_source.py b/cartridges/importer/flatpak_source.py index 24ac57c..a12bd5b 100644 --- a/cartridges/importer/flatpak_source.py +++ b/cartridges/importer/flatpak_source.py @@ -76,7 +76,7 @@ class FlatpakSourceIterable(SourceIterable): name = keyfile.get_string("Desktop Entry", "Name") - except GLib.GError: + except GLib.Error: continue values = { @@ -106,7 +106,7 @@ class FlatpakSourceIterable(SourceIterable): additional_data = {"local_icon_path": Path(icon_path)} else: pass - except GLib.GError: + except GLib.Error: pass yield (game, additional_data) diff --git a/cartridges/preferences.py b/cartridges/preferences.py index 98fc7fc..a0d158e 100644 --- a/cartridges/preferences.py +++ b/cartridges/preferences.py @@ -393,7 +393,7 @@ class PreferencesWindow(Adw.PreferencesWindow): """Callback called when a dir picker button is clicked""" try: path = Path(self.file_chooser.select_folder_finish(result).get_path()) - except GLib.GError: + except GLib.Error: return # Good picked location diff --git a/cartridges/utils/save_cover.py b/cartridges/utils/save_cover.py index e8d49e7..d5ad44f 100644 --- a/cartridges/utils/save_cover.py +++ b/cartridges/utils/save_cover.py @@ -82,7 +82,7 @@ def convert_cover( tmp_path := Gio.File.new_tmp("XXXXXX.tiff")[0].get_path() ) return convert_cover(tmp_path) - except GLib.GError: + except GLib.Error: return None return tmp_path diff --git a/search-provider/cartridges-search-provider.in b/search-provider/cartridges-search-provider.in index adf531e..be1cfaf 100755 --- a/search-provider/cartridges-search-provider.in +++ b/search-provider/cartridges-search-provider.in @@ -204,7 +204,7 @@ class SearchCartridgesService(Server, Gio.Application): pixbuf = GdkPixbuf.Pixbuf.new_from_file_at_scale( str(path), -1, 32, True ) - except GLib.GError as e: + except GLib.Error as e: print(e) continue elif (path := shared.covers_dir / (game_id + ".gif")).is_file(): @@ -212,7 +212,7 @@ class SearchCartridgesService(Server, Gio.Application): pixbuf = GdkPixbuf.PixbufAnimation.new_from_file( str(path) ).get_static_image() - except GLib.GError as e: + except GLib.Error as e: print(e) continue d = {