fix(fonts): call the font manager's forget methods without a None-able local

Pylint E1102 (Codacy) read getattr(..., None) as possibly not callable.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chuck
2026-10-04 17:11:09 -04:00
co-authored by Claude Opus 5.5
parent 10ac608b9d
commit 686b00d224
+2 -3
View File
@@ -606,11 +606,10 @@ class PluginManager:
if self.font_manager is None:
return
for name in ('forget_manager_fonts', 'forget_plugin_fonts'):
forget = getattr(self.font_manager, name, None)
if forget is None:
if not hasattr(self.font_manager, name):
continue
try:
forget(plugin_id)
getattr(self.font_manager, name)(plugin_id)
except Exception as e:
self.logger.debug("Could not forget fonts of %s (%s): %s", plugin_id, name, e)