@@ -739,23 +739,23 @@ def get_init_log(self):
739739 self ._init_log = []
740740 return init_log
741741
742- def _log (self , log_level , log_str ) :
742+ def _log (self , log_level : int , log_str : str ) -> None :
743743 self ._init_log .append ((log_level , log_str ))
744744
745745 def _load_from_disk (self , path = None ):
746746 # Validate `path`, or if not provided, use CONFIG_FILE_PATH if it exists.
747747 if path :
748- self ._init_log . append (( logging .INFO , f"Loading config from file:\n { path } " ) )
748+ self ._log ( logging .INFO , f"Loading config from file:\n { path } " )
749749 if not os .path .exists (path ):
750- self ._init_log . append (( logging .ERROR , f"File not found: { path } " ) )
750+ self ._log ( logging .ERROR , f"File not found: { path } " )
751751 raise ConfigLoadFailure (self ._init_log )
752752 else :
753753 # Gracefully handle the case where there isn't a user config file.
754754 if not os .path .exists (CONFIG_FILE_PATH ):
755- self ._init_log . append (( logging .DEBUG , "User config file not found." ) )
755+ self ._log ( logging .DEBUG , "User config file not found." )
756756 return
757757 path = CONFIG_FILE_PATH
758- self ._init_log . append (( logging .INFO , f"Loading user config file:\n { path } " ) )
758+ self ._log ( logging .INFO , f"Loading user config file:\n { path } " )
759759 # Try to load and parse the config file at `path`.
760760 config = ConfigParser ()
761761 try :
@@ -770,7 +770,7 @@ def _load_from_disk(self, path=None):
770770 # the parsed options (i.e. that the options have valid values).
771771 (config , logs ) = _parse_config (config )
772772 for verbosity , message in logs :
773- self ._init_log . append (( verbosity , message ) )
773+ self ._log ( verbosity , message )
774774 if config is None :
775775 raise ConfigLoadFailure (self ._init_log )
776776 self ._config = config
0 commit comments