mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-10 17:16:36 +00:00
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:
@@ -626,9 +626,8 @@ class PluginManager:
|
|||||||
|
|
||||||
# Its font registrations go with it (the Fonts tab's "Used by").
|
# Its font registrations go with it (the Fonts tab's "Used by").
|
||||||
try:
|
try:
|
||||||
forget = getattr(self.font_manager, 'forget_manager_fonts', None)
|
if self.font_manager is not None and hasattr(self.font_manager, 'forget_manager_fonts'):
|
||||||
if callable(forget):
|
self.font_manager.forget_manager_fonts(plugin_id)
|
||||||
forget(plugin_id)
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.debug("Could not forget fonts of %s: %s", plugin_id, e)
|
self.logger.debug("Could not forget fonts of %s: %s", plugin_id, e)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user