mirror of
https://github.com/ChuckBuilds/LEDMatrix.git
synced 2026-10-05 14:55:08 +00:00
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:
@@ -606,11 +606,10 @@ class PluginManager:
|
|||||||
if self.font_manager is None:
|
if self.font_manager is None:
|
||||||
return
|
return
|
||||||
for name in ('forget_manager_fonts', 'forget_plugin_fonts'):
|
for name in ('forget_manager_fonts', 'forget_plugin_fonts'):
|
||||||
forget = getattr(self.font_manager, name, None)
|
if not hasattr(self.font_manager, name):
|
||||||
if forget is None:
|
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
forget(plugin_id)
|
getattr(self.font_manager, name)(plugin_id)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.debug("Could not forget fonts of %s (%s): %s", plugin_id, name, e)
|
self.logger.debug("Could not forget fonts of %s (%s): %s", plugin_id, name, e)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user