Skip to content

Commit

Permalink
fix: use GLib.Error instead of GLib.GError
Browse files Browse the repository at this point in the history
  • Loading branch information
linkfrg committed Feb 11, 2025
1 parent fbbf261 commit 858233c
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion ignis/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@


def raise_css_parsing_error(
css_provider: Gtk.CssProvider, section: Gtk.CssSection, gerror: GLib.GError
css_provider: Gtk.CssProvider, section: Gtk.CssSection, gerror: GLib.Error
) -> None:
raise CssParsingError(section, gerror)

Expand Down
2 changes: 1 addition & 1 deletion ignis/base_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@


def raise_css_parsing_error(
css_provider: Gtk.CssProvider, section: Gtk.CssSection, gerror: GLib.GError
css_provider: Gtk.CssProvider, section: Gtk.CssSection, gerror: GLib.Error
) -> None:
raise CssParsingError(section, gerror)

Expand Down
6 changes: 3 additions & 3 deletions ignis/dbus.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def get_dbus_property(self, property_name: str) -> Any:
-1,
None,
)[0]
except GLib.GError: # type: ignore
except GLib.Error:
return None

def get_dbus_property_async(
Expand All @@ -548,7 +548,7 @@ def get_dbus_property_async(
Args:
property_name: The name of the property.
callback: A function to call when the retrieval is complete. The function will receive the property's value or :class:`GLib.GError` in case of an error.
callback: A function to call when the retrieval is complete. The function will receive the property's value or :class:`GLib.Error` in case of an error.
*user_data: User data to pass to ``callback``.
"""

Expand All @@ -563,7 +563,7 @@ def run_callback(value):
# GLib.Variant can contain a lot of data, e.g., pixbuf
# so unpack it in another thread to prevent the mainloop from blocking
Utils.ThreadTask(target=lambda: result[0], callback=run_callback).run()
except GLib.GError as gerror: # type: ignore
except GLib.Error as gerror:
run_callback(gerror)

return self.connection.call(
Expand Down
4 changes: 2 additions & 2 deletions ignis/dbus_menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ def __update_menu(self) -> None:
)

def __load_layout(self, proxy, result, user_data) -> None:
if isinstance(result, GLib.GError):
if isinstance(result, GLib.Error):
return

self._menu_id = result[1][0]
Expand Down Expand Up @@ -167,6 +167,6 @@ def copy(self) -> "DBusMenu":
def popup(self) -> None:
try:
self.__proxy.AboutToShow("(i)", self._menu_id)
except GLib.GError: # type: ignore
except GLib.Error:
pass
return super().popup()
4 changes: 2 additions & 2 deletions ignis/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ class CssParsingError(Exception):
"""

def __init__(
self, section: Gtk.CssSection, gerror: GLib.GError, *args: object
self, section: Gtk.CssSection, gerror: GLib.Error, *args: object
) -> None:
self._section = section
self._gerror = gerror
Expand All @@ -420,7 +420,7 @@ def section(self) -> Gtk.CssSection:
return self._section

@property
def gerror(self) -> GLib.GError:
def gerror(self) -> GLib.Error:
"""
- required, read-only
Expand Down
2 changes: 1 addition & 1 deletion ignis/services/bluetooth/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ def __connect_service(self, connect: bool) -> None:
def callback(x, res):
try:
self._client.connect_service_finish(res)
except GLib.GError as gerror: # type: ignore
except GLib.Error as gerror:
logger.warning(gerror.message)

self._client.connect_service(
Expand Down
2 changes: 1 addition & 1 deletion ignis/widgets/file_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def __open_callback(self, dialog, result) -> None:
file = self.select_folder_finish(result)
else:
file = dialog.open_finish(result)
except GLib.GError: # type: ignore
except GLib.Error:
return

if file is not None:
Expand Down

0 comments on commit 858233c

Please sign in to comment.