Skip to content

Commit a4b9b6b

Browse files
committed
Check if tar.gz exists before deleting in VivadoAcc backend
1 parent 91f8f83 commit a4b9b6b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hls4ml/writer/vivado_accelerator_writer.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,9 @@ def write_driver(self, model):
408408
)
409409

410410
def write_new_tar(self, model):
411-
os.remove(model.config.get_output_dir() + '.tar.gz')
411+
tarfile = model.config.get_output_dir() + '.tar.gz'
412+
if os.path.exists(tarfile):
413+
os.remove(tarfile)
412414
super().write_tar(model)
413415

414416
def write_hls(self, model):

0 commit comments

Comments
 (0)