From 0757668709f00190c357549f3eb5101566da0bde Mon Sep 17 00:00:00 2001 From: Mat Date: Sat, 2 Nov 2024 10:22:35 +0200 Subject: [PATCH] popupmenu.py: fix crash in older PyGObject versions on macOS Fixes #3176 --- pynicotine/gtkgui/widgets/popupmenu.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pynicotine/gtkgui/widgets/popupmenu.py b/pynicotine/gtkgui/widgets/popupmenu.py index 7c7230ba8c58..afc767213213 100644 --- pynicotine/gtkgui/widgets/popupmenu.py +++ pynicotine/gtkgui/widgets/popupmenu.py @@ -296,7 +296,11 @@ def _callback_click_gtk4(self, controller, _num_p, pos_x, pos_y): def _callback_click_gtk4_darwin(self, controller, _num_p, pos_x, pos_y): - event = controller.get_last_event() + try: + event = controller.get_last_event() + except TypeError: + # PyGObject <3.48.0 + return False if event.triggers_context_menu(): return self._callback(controller, pos_x, pos_y)