88from django .core .management import CommandError
99
1010
11- class ArgumentParserDefaults ( object ) :
11+ class ArgumentParserDefaults :
1212 def __init__ (self , args ):
1313 self ._args = args
1414
@@ -18,7 +18,7 @@ def _get_kwargs(self):
1818 }
1919
2020
21- class ArgumentParserAdapter ( object ) :
21+ class ArgumentParserAdapter :
2222 def __init__ (self ):
2323 self ._actions = []
2424 self ._mutually_exclusive_groups = []
@@ -27,7 +27,7 @@ def parse_args(self, args):
2727 return ArgumentParserDefaults (args )
2828
2929
30- class DjangoCommandMixin ( object ) :
30+ class DjangoCommandMixin :
3131 use_argparse = False
3232 option_list = []
3333 base_stealth_options = []
@@ -40,13 +40,13 @@ def stealth_options(self):
4040
4141 def invoke (self , ctx ):
4242 try :
43- return super (DjangoCommandMixin , self ).invoke (ctx )
43+ return super ().invoke (ctx )
4444 except CommandError as e :
4545 # Honor the --traceback flag
4646 if ctx .traceback : # NOCOV
4747 raise
4848 styled_message = click .style (
49- "{}: {}" . format ( e .__class__ .__name__ , e ) , fg = "red" , bold = True
49+ f" { e .__class__ .__name__ } : { e } " , fg = "red" , bold = True
5050 )
5151 click .echo (styled_message , err = True )
5252 ctx .exit (1 )
@@ -55,7 +55,7 @@ def run_from_argv(self, argv):
5555 """
5656 Called when run from the command line.
5757 """
58- prog_name = "{} {}" . format ( os .path .basename (argv [0 ]), argv [1 ])
58+ prog_name = f" { os .path .basename (argv [0 ])} { argv [1 ]} "
5959 try :
6060 # We won't get an exception here in standalone_mode=False
6161 exit_code = self .main (
@@ -76,7 +76,7 @@ def create_parser(self, progname, subcommand):
7676 return ArgumentParserAdapter ()
7777
7878 def print_help (self , prog_name , subcommand ):
79- prog_name = "{ } {}" . format ( prog_name , subcommand )
79+ prog_name = f" { prog_name } { subcommand } "
8080 self .main (["--help" ], prog_name = prog_name , standalone_mode = False )
8181
8282 def map_names (self ):
@@ -140,7 +140,7 @@ def suppress_colors(ctx, param, value):
140140 return value
141141
142142
143- class BaseRegistrator ( object ) :
143+ class BaseRegistrator :
144144 common_options = [
145145 click .option (
146146 "-v" ,
0 commit comments