From: Stefan Behnel Date: Wed, 28 Nov 2012 20:15:28 +0000 (+0100) Subject: fix 'cimport cython' in string code fragments X-Git-Tag: 0.18b1~135^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=37724cccf7258445d4d5b710519fbf4bcc2df7dc;p=platform%2Fupstream%2Fpython-cython.git fix 'cimport cython' in string code fragments --- diff --git a/Cython/Compiler/TreeFragment.py b/Cython/Compiler/TreeFragment.py index 29ff12d..9832959 100644 --- a/Cython/Compiler/TreeFragment.py +++ b/Cython/Compiler/TreeFragment.py @@ -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)