diff mbox series

[swugenerator,13/13] generator.py: Fix default value for conf member

Message ID 20230110181237.410579-14-colin.mcallister@garmin.com
State Accepted
Headers show
Series Refactoring Python code | expand

Commit Message

McAllister, Colin Jan. 10, 2023, 6:12 p.m. UTC
From: Colin McAllister <colinmca242@gmail.com>

SWUGenerator.conf is initialized as an empty dict, however it is
assigned the object returned by libconf.loads(), which is a AttrDict and
allows access to string keys via attribute access. However, Pylint
considers conf to be a dict and raises error E1101 when a conf attribute
is used. To be more clear in the code and also remove the Pylint error,
SWUGenerator.conf is intialized as an empty AttrDict.

Signed-off-by: Colin McAllister <colinmca242@gmail.com>
---
 swugenerator/generator.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/swugenerator/generator.py b/swugenerator/generator.py
index d25e0f3..69f174c 100644
--- a/swugenerator/generator.py
+++ b/swugenerator/generator.py
@@ -39,7 +39,7 @@  class SWUGenerator:
         self.cpiofile = SWUFile(self.out)
         self.vars = confvars
         self.lines = []
-        self.conf = {}
+        self.conf = libconf.AttrDict()
         self.filelist = []
         self.temp = TemporaryDirectory()
         self.signtool = crypt