Changed code to be python < 3.6 compatible
This commit is contained in:
parent
541d5ce7cb
commit
5dfe448a9a
@ -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
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user