diff --git a/mylib/config.py b/mylib/config.py index 94c3293..f2acf42 100644 --- a/mylib/config.py +++ b/mylib/config.py @@ -864,7 +864,9 @@ class Config: # pylint: disable=too-many-instance-attributes comment=( "File log level limit : by default, all logged messages (according to main log " "level) will be logged to the log file, but you can set a minimal level if you " - f"want. Possible values: {', '.join(logging.getLevelNamesMapping())}." + # logging.getLevelNamesMapping() not available in python 3.9 + # pylint: disable=protected-access + f"want. Possible values: {', '.join(logging._nameToLevel)}." ), ) @@ -968,7 +970,9 @@ class Config: # pylint: disable=too-many-instance-attributes if self.get("logfile", "path"): logfile_handler = logging.FileHandler(self.get("logfile", "path")) logfile_level = ( - logging.getLevelNamesMapping().get(self.get("logfile", "level")) + # logging.getLevelNamesMapping() not available in python 3.9 + # pylint: disable=protected-access + logging._nameToLevel.get(self.get("logfile", "level")) if self.get("logfile", "level") else logging.DEBUG )