summaryrefslogtreecommitdiff
path: root/Cython/Compiler/UtilityCode.py
diff options
context:
space:
mode:
authorStefan Behnel <stefan_ml@behnel.de>2015-04-05 12:34:46 +0200
committerStefan Behnel <stefan_ml@behnel.de>2015-04-05 12:34:46 +0200
commite3f5343f3b648fc0033bdaf0def3268abab7b9ea (patch)
tree8478a914732063768ab833bfa17e60696662c348 /Cython/Compiler/UtilityCode.py
parentcdd572ef9b19db9512b6b6a17fea1868e8b3740b (diff)
downloadcython-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.py4
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.")