mirror of
https://github.com/miurahr/aqtinstall.git
synced 2025-12-18 13:14:37 +03:00
Fix failure to use fallback for getlist
aqt.helper.MyConfigParser.getlist fails to retrieve a fallback list when the `section` parameter does not exist in the `settings.ini` file. This ensures that the fallback is used when that key is missing.
This commit is contained in:
@@ -283,7 +283,9 @@ def xml_to_modules(
|
|||||||
|
|
||||||
class MyConfigParser(configparser.ConfigParser):
|
class MyConfigParser(configparser.ConfigParser):
|
||||||
def getlist(self, section: str, option: str, fallback=[]) -> List[str]:
|
def getlist(self, section: str, option: str, fallback=[]) -> List[str]:
|
||||||
value = self.get(section, option)
|
value = self.get(section, option, fallback=None)
|
||||||
|
if value is None:
|
||||||
|
return fallback
|
||||||
try:
|
try:
|
||||||
result = list(filter(None, (x.strip() for x in value.splitlines())))
|
result = list(filter(None, (x.strip() for x in value.splitlines())))
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
Reference in New Issue
Block a user