From 40ba765faddaa23b5156e5f2f87261f377ec1c00 Mon Sep 17 00:00:00 2001 From: James Murphy Date: Mon, 8 Nov 2021 18:22:51 -0600 Subject: [PATCH] Don't error if path is already fullpath copyfile raises a SameFileError if the source and destination are the same. In this case, the error should be ignored. --- src/python/setup.py.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/python/setup.py.cmake b/src/python/setup.py.cmake index a4713a9..2e79bca 100644 --- a/src/python/setup.py.cmake +++ b/src/python/setup.py.cmake @@ -60,7 +60,10 @@ if '${MAGNUM_BUILD_STATIC}' != 'ON': class TheExtensionIsAlreadyBuiltWhyThisHasToBeSoDamnComplicated(build_ext): def run(self): for ext in self.extensions: - shutil.copyfile(extension_paths[ext.name], self.get_ext_fullpath(ext.name)) + try: + shutil.copyfile(extension_paths[ext.name], self.get_ext_fullpath(ext.name)) + except shutil.SameFileError: + pass setup( name='magnum',