From 3f2d61a0fa34aea3127b648e578f18fc57d77c2d Mon Sep 17 00:00:00 2001 From: Eren Dogan Date: Sun, 3 Sep 2023 18:21:31 -0700 Subject: [PATCH] Prevent same file error when copying the config file (VLSIDA/PrivateRAM#108) --- compiler/sram.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/compiler/sram.py b/compiler/sram.py index cc269d8f..15505c33 100644 --- a/compiler/sram.py +++ b/compiler/sram.py @@ -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)