From 10cf1f7c00d31739cead4ac1d2f78241e49bb9ff Mon Sep 17 00:00:00 2001 From: derrod Date: Sat, 30 May 2020 21:15:13 +0200 Subject: [PATCH] [lfs] Ensure "Legendary" config section exists Fixes #50 --- legendary/lfs/lgndry.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/legendary/lfs/lgndry.py b/legendary/lfs/lgndry.py index 8c59b2c..13cbaa2 100644 --- a/legendary/lfs/lgndry.py +++ b/legendary/lfs/lgndry.py @@ -37,6 +37,9 @@ class LGDLFS: # try loading config self.config.read(os.path.join(self.path, 'config.ini')) + # make sure "Legendary" section exists + if 'Legendary' not in self.config: + self.config['Legendary'] = dict() try: self._installed = json.load(open(os.path.join(self.path, 'installed.json')))