@@ -400,7 +400,7 @@ def _log_default(self) -> AnyLogger:
400400 # this must be a dict of two-tuples,
401401 # the first element being the application class/import string
402402 # and the second being the help string for the subcommand
403- subcommands = Dict ()
403+ subcommands : dict [ str , t . Any ] | Dict = Dict ()
404404 # parse_command_line will initialize a subapp, if requested
405405 subapp = Instance ("traitlets.config.application.Application" , allow_none = True )
406406
@@ -891,15 +891,15 @@ def parse_command_line(self, argv: ArgvType = None) -> None:
891891 def _load_config_files (
892892 cls ,
893893 basefilename : str ,
894- path : list [ str | None ] | None = None ,
894+ path : str | t . Sequence [ str | None ] | None ,
895895 log : AnyLogger | None = None ,
896896 raise_config_file_errors : bool = False ,
897897 ) -> t .Generator [t .Any , None , None ]:
898898 """Load config files (py,json) by filename and path.
899899
900900 yield each config object in turn.
901901 """
902- if not isinstance (path , list ) :
902+ if isinstance (path , str ) or path is None :
903903 path = [path ]
904904 for current in reversed (path ):
905905 # path list is in descending priority order, so load files backwards:
@@ -949,7 +949,9 @@ def loaded_config_files(self) -> list[str]:
949949 return self ._loaded_config_files [:]
950950
951951 @catch_config_error
952- def load_config_file (self , filename : str , path : list [str | None ] | None = None ) -> None :
952+ def load_config_file (
953+ self , filename : str , path : str | t .Sequence [str | None ] | None = None
954+ ) -> None :
953955 """Load config files by filename and path."""
954956 filename , ext = os .path .splitext (filename )
955957 new_config = Config ()
@@ -1032,7 +1034,7 @@ def close_handlers(self) -> None:
10321034 handler .close ()
10331035 self ._logging_configured = False
10341036
1035- def exit (self , exit_status : int = 0 ) -> None :
1037+ def exit (self , exit_status : int | str | None = 0 ) -> None :
10361038 self .log .debug ("Exiting application: %s" % self .name )
10371039 self .close_handlers ()
10381040 sys .exit (exit_status )
0 commit comments