diff --git a/docxtpl/__main__.py b/docxtpl/__main__.py index 0cb838b..2438419 100644 --- a/docxtpl/__main__.py +++ b/docxtpl/__main__.py @@ -65,7 +65,8 @@ def check_exists_ask_overwrite(arg_value, overwrite): # confirmed returns True, else raises FileExistsError. if os.path.exists(arg_value) and not overwrite: try: - if input('File %s already exists, would you like to overwrite the existing file? (y/n)' % arg_value).lower() == 'y': + msg = 'File %s already exists, would you like to overwrite the existing file? (y/n)' % arg_value + if input(msg).lower() == 'y': return True else: raise FileExistsError diff --git a/tests/module_execute.py b/tests/module_execute.py index c280600..e2ef28f 100644 --- a/tests/module_execute.py +++ b/tests/module_execute.py @@ -16,4 +16,4 @@ print('Executing "%s" ...' % cmd) os.system(cmd) if os.path.exists(OUTPUT_FILENAME): - print(f' --> File %s has been generated.' % OUTPUT_FILENAME) + print(' --> File %s has been generated.' % OUTPUT_FILENAME)