diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2015-04-05 12:34:46 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2015-04-05 12:34:46 +0200 |
commit | e3f5343f3b648fc0033bdaf0def3268abab7b9ea (patch) | |
tree | 8478a914732063768ab833bfa17e60696662c348 /Cython/Compiler/UtilityCode.py | |
parent | cdd572ef9b19db9512b6b6a17fea1868e8b3740b (diff) | |
download | cython-e3f5343f3b648fc0033bdaf0def3268abab7b9ea.tar.gz |
prevent fallback to absolute cimport when relative cimport is not found; generally clean up relative cimport code
Diffstat (limited to 'Cython/Compiler/UtilityCode.py')
-rw-r--r-- | Cython/Compiler/UtilityCode.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Cython/Compiler/UtilityCode.py b/Cython/Compiler/UtilityCode.py index 01c2c9e81..9f7bebb81 100644 --- a/Cython/Compiler/UtilityCode.py +++ b/Cython/Compiler/UtilityCode.py @@ -34,7 +34,9 @@ class NonManglingModuleScope(Symtab.ModuleScope): class CythonUtilityCodeContext(StringParseContext): scope = None - def find_module(self, module_name, relative_to=None, pos=None, need_pxd=True): + def find_module(self, module_name, relative_to=None, pos=None, need_pxd=True, absolute_fallback=True): + if relative_to: + raise AssertionError("Relative imports not supported in utility code.") if module_name != self.module_name: if module_name not in self.modules: raise AssertionError("Only the cython cimport is supported.") |