Commit 3719264b authored by scoder's avatar scoder

Merge pull request #380 from jdemeyer/fix_cimport_cpython

Fix relative cimport for Cython package dirs
parents 3bfdb38f 2982a995
...@@ -45,7 +45,7 @@ except ImportError: ...@@ -45,7 +45,7 @@ except ImportError:
from distutils.extension import Extension from distutils.extension import Extension
from .. import Utils from .. import Utils
from ..Utils import cached_function, cached_method, path_exists, find_root_package_dir from ..Utils import cached_function, cached_method, path_exists, find_root_package_dir, is_package_dir
from ..Compiler.Main import Context, CompilationOptions, default_options from ..Compiler.Main import Context, CompilationOptions, default_options
join_path = cached_function(os.path.join) join_path = cached_function(os.path.join)
...@@ -383,7 +383,7 @@ def resolve_depend(depend, include_dirs): ...@@ -383,7 +383,7 @@ def resolve_depend(depend, include_dirs):
@cached_function @cached_function
def package(filename): def package(filename):
dir = os.path.dirname(os.path.abspath(str(filename))) dir = os.path.dirname(os.path.abspath(str(filename)))
if dir != filename and path_exists(join_path(dir, '__init__.py')): if dir != filename and is_package_dir(dir):
return package(dir) + (os.path.basename(dir),) return package(dir) + (os.path.basename(dir),)
else: else:
return () return ()
......
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