From adb4520f3dac1250e854f9c4a4be2aef4b08d9c3 Mon Sep 17 00:00:00 2001 From: Chuck <33324927+ChuckBuilds@users.noreply.github.com> Date: Wed, 23 Sep 2026 13:29:50 -0400 Subject: [PATCH] fix: call forget_manager_fonts through a hasattr check pylint can follow getattr(..., None) then callable() is fine at runtime, but pylint's E1102 ("not callable") can't see through it, and Codacy fails the check on it. Co-Authored-By: Claude Opus 5.5 --- src/plugin_system/plugin_manager.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/plugin_system/plugin_manager.py b/src/plugin_system/plugin_manager.py index ba493f25..27502f02 100644 --- a/src/plugin_system/plugin_manager.py +++ b/src/plugin_system/plugin_manager.py @@ -626,9 +626,8 @@ class PluginManager: # Its font registrations go with it (the Fonts tab's "Used by"). try: - forget = getattr(self.font_manager, 'forget_manager_fonts', None) - if callable(forget): - forget(plugin_id) + if self.font_manager is not None and hasattr(self.font_manager, 'forget_manager_fonts'): + self.font_manager.forget_manager_fonts(plugin_id) except Exception as e: self.logger.debug("Could not forget fonts of %s: %s", plugin_id, e)