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.
|
# confirmed returns True, else raises FileExistsError.
|
||||||
if os.path.exists(arg_value) and not overwrite:
|
if os.path.exists(arg_value) and not overwrite:
|
||||||
try:
|
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
|
return True
|
||||||
else:
|
else:
|
||||||
raise FileExistsError
|
raise FileExistsError
|
||||||
|
|||||||
@ -16,4 +16,4 @@ print('Executing "%s" ...' % cmd)
|
|||||||
os.system(cmd)
|
os.system(cmd)
|
||||||
|
|
||||||
if os.path.exists(OUTPUT_FILENAME):
|
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