1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-22 21:50:55 +00:00
nixpkgs/pkgs/development/python-modules/astropy-extension-helpers/permissions.patch
2020-12-28 15:16:20 -05:00

21 lines
934 B
Diff

diff --git a/extension_helpers/_setup_helpers.py b/extension_helpers/_setup_helpers.py
index ec3e547..e2419f7 100644
--- a/extension_helpers/_setup_helpers.py
+++ b/extension_helpers/_setup_helpers.py
@@ -79,8 +79,13 @@ def get_extensions(srcdir='.'):
if len(ext_modules) > 0:
main_package_dir = min(packages, key=len)
src_path = os.path.join(os.path.dirname(__file__), 'src')
- shutil.copy(os.path.join(src_path, 'compiler.c'),
- os.path.join(srcdir, main_package_dir, '_compiler.c'))
+ a = os.path.join(src_path, 'compiler.c')
+ b = os.path.join(srcdir, main_package_dir, '_compiler.c')
+ try:
+ os.unlink(b)
+ except OSError:
+ pass
+ shutil.copy(a, b)
ext = Extension(main_package_dir + '.compiler_version',
[os.path.join(main_package_dir, '_compiler.c')])
ext_modules.append(ext)