Skip to content

Commit

Permalink
handle SameFileError
Browse files Browse the repository at this point in the history
  • Loading branch information
mirkobrombin committed May 28, 2022
1 parent fca16e9 commit bb1e8a7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/backend/managers/dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,13 @@ def __step_copy_dll(self, config: dict, step: dict):
if os.path.exists(_dest) and os.path.islink(_dest):
os.unlink(_dest)

shutil.copyfile(os.path.join(path, _name), _dest)
try:
shutil.copyfile(os.path.join(path, _name), _dest)
except shutil.SameFileError:
logging.info(f"{_name} already exists at the same version, skipping.")

except Exception:
except Exception as e:
print(e)
logging.warning("An error occurred while copying dlls.")
return False

Expand Down

0 comments on commit bb1e8a7

Please sign in to comment.