3030 sys .exit (1 )
3131
3232if not os .path .isfile (target_file_path ):
33- print ("No such file: '{}'" . format ( target_file_path ) )
33+ print (f "No such file: '{ target_file_path } '" )
3434 sys .exit (2 )
3535
3636
@@ -41,17 +41,17 @@ def get_git_version():
4141
4242version = get_git_version ()
4343
44- with open (target_file_path , "r" ) as target_file :
44+ with open (target_file_path ) as target_file :
4545 target_content = target_file .read ()
4646
4747if format_ == "deb" :
48- updated_content = re .sub (r"(Version:)\w*(.*)" , "\\ 1 {}" . format ( version ) , target_content )
48+ updated_content = re .sub (r"(Version:)\w*(.*)" , f "\\ 1 { version } " , target_content )
4949elif format_ == "setup.py" :
50- updated_content = re .sub (r"(version)\w*=(.*)'" , "\\ 1='{}'" . format ( version ) , target_content )
50+ updated_content = re .sub (r"(version)\w*=(.*)'" , f "\\ 1='{ version } '" , target_content )
5151elif format_ == "__version__" :
52- updated_content = re .sub (r"(__version__)\w*(.*)" , "\\ 1 = '{}'" . format ( version ) , target_content )
52+ updated_content = re .sub (r"(__version__)\w*(.*)" , f "\\ 1 = '{ version } '" , target_content )
5353else :
54- print ("Format must be 'deb', 'setup.py' or '__version__', not '{}'" . format ( format_ ) )
54+ print (f "Format must be 'deb', 'setup.py' or '__version__', not '{ format_ } '" )
5555
5656if "--inplace" in args :
5757 with open (target_file_path , "w" ) as target_file :
0 commit comments