fix 'cimport cython' in string code fragments
authorStefan Behnel <stefan_ml@behnel.de>
Wed, 28 Nov 2012 20:15:28 +0000 (21:15 +0100)
committerStefan Behnel <stefan_ml@behnel.de>
Wed, 28 Nov 2012 20:15:28 +0000 (21:15 +0100)
Cython/Compiler/TreeFragment.py

index 29ff12d..9832959 100644 (file)
@@ -26,7 +26,7 @@ class StringParseContext(Main.Context):
         self.module_name = name
 
     def find_module(self, module_name, relative_to = None, pos = None, need_pxd = 1):
-        if module_name != self.module_name:
+        if module_name not in (self.module_name, 'cython'):
             raise AssertionError("Not yet supporting any cimports/includes from string code snippets")
         return ModuleScope(module_name, parent_module = None, context = self)