Commit 3dfac3e2 authored by Stefan Behnel's avatar Stefan Behnel

more code cleanups

parent 3f44b92a
...@@ -673,13 +673,14 @@ def cythonize(module_list, exclude=[], nthreads=0, aliases=None, quiet=False, fo ...@@ -673,13 +673,14 @@ def cythonize(module_list, exclude=[], nthreads=0, aliases=None, quiet=False, fo
for m in module_list: for m in module_list:
if build_dir: if build_dir:
root = os.path.realpath(os.path.abspath(m.name.split('.')[0])) root = os.path.realpath(os.path.abspath(m.name.split('.')[0]))
def copy_to_build_dir(file): def copy_to_build_dir(filepath, root=root):
if os.path.realpath(os.path.abspath(file)).startswith(root): filepath = os.path.abspath(filepath)
dir = os.path.join( if os.path.realpath(filepath).startswith(root):
build_dir, os.path.dirname(_relpath(file))) mod_dir = os.path.join(
if not os.path.isdir(dir): build_dir, os.path.dirname(_relpath(filepath)))
os.makedirs(dir) if not os.path.isdir(mod_dir):
shutil.copy(file, dir) os.makedirs(mod_dir)
shutil.copy(filepath, mod_dir)
for dep in m.depends: for dep in m.depends:
copy_to_build_dir(dep) copy_to_build_dir(dep)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment