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 <noreply@anthropic.com>
This commit is contained in:
Chuck
2026-09-23 13:29:50 -04:00
co-authored by Claude Opus 5.5
parent 93123aae7a
commit adb4520f3d
+2 -3
View File
@@ -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)