fully fix build_dir copying
authorR. Andrew Ohana <andrew.ohana@gmail.com>
Sun, 12 May 2013 06:15:39 +0000 (23:15 -0700)
committerR. Andrew Ohana <andrew.ohana@gmail.com>
Sun, 12 May 2013 06:15:39 +0000 (23:15 -0700)
Cython/Build/Dependencies.py

index a2676e1..5e73782 100644 (file)
@@ -671,10 +671,10 @@ def cythonize(module_list, exclude=[], nthreads=0, aliases=None, quiet=False, fo
         if build_dir:
             root = os.path.realpath(os.path.abspath(find_root_package_dir(m.sources[0])))
             def copy_to_build_dir(filepath, root=root):
-                filepath = os.path.abspath(filepath)
-                if os.path.realpath(filepath).startswith(root):
-                    mod_dir = os.path.join(
-                        build_dir, os.path.dirname(_relpath(filepath)))
+                filepath = os.path.realpath(os.path.abspath(filepath))
+                if filepath.startswith(root):
+                    mod_dir = os.path.join(build_dir,
+                            os.path.dirname(_relpath(filepath, root)))
                     if not os.path.isdir(mod_dir):
                         os.makedirs(mod_dir)
                     shutil.copy(filepath, mod_dir)