From 72762e5a8f758518f9adc06dd2dcce9e0efacd0d Mon Sep 17 00:00:00 2001 From: mattip Date: Wed, 12 Dec 2018 11:30:06 +0200 Subject: [PATCH] DEV: use abspath on windows --- numpy/distutils/command/build_ext.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py index ab9d585a5558..01d6cd7dfade 100644 --- a/numpy/distutils/command/build_ext.py +++ b/numpy/distutils/command/build_ext.py @@ -509,7 +509,11 @@ def _process_unlinkable_fobjects(self, objects, libraries, # Wrap unlinkable objects to a linkable one if unlinkable_fobjects: - fobjects = [os.path.relpath(obj) for obj in unlinkable_fobjects] + if os.name == 'nt': + # relpath fails if we are on a different drive + fobjects = [os.path.abspath(obj) for obj in unlinkable_fobjects] + else: + fobjects = [os.path.relpath(obj) for obj in unlinkable_fobjects] wrapped = fcompiler.wrap_unlinkable_objects( fobjects, output_dir=self.build_temp, extra_dll_dir=self.extra_dll_dir)