Prevent same file error when copying the config file (VLSIDA/PrivateRAM#108)

This commit is contained in:
Eren Dogan 2023-09-03 18:21:31 -07:00
parent 1a25fcf9a5
commit 3f2d61a0fa
1 changed files with 5 additions and 2 deletions

View File

@ -193,8 +193,11 @@ class sram():
# Write the config file
start_time = datetime.datetime.now()
from shutil import copyfile
copyfile(OPTS.config_file, OPTS.output_path + OPTS.output_name + '.py')
try:
from shutil import copyfile
copyfile(OPTS.config_file, OPTS.output_path + OPTS.output_name + '.py')
except shutil.SameFileError:
pass
debug.print_raw("Config: Writing to {0}".format(OPTS.output_path + OPTS.output_name + '.py'))
print_time("Config", datetime.datetime.now(), start_time)