From: Dag Sverre Seljebotn Date: Wed, 15 Apr 2009 14:15:37 +0000 (+0200) Subject: Add warning in situations where command line directive behaviour will change in 0.12 X-Git-Tag: 0.11.1~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4305ac87f3cf673147274a7b26f1a67845e3e3bd;p=cython.git Add warning in situations where command line directive behaviour will change in 0.12 --- diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py index cd15015b..bd704d44 100644 --- a/Cython/Compiler/ParseTreeTransforms.py +++ b/Cython/Compiler/ParseTreeTransforms.py @@ -332,13 +332,20 @@ class InterpretCompilerDirectives(CythonTransform, SkipDeclarations): def __init__(self, context, compilation_option_overrides): super(InterpretCompilerDirectives, self).__init__(context) - self.compilation_option_overrides = compilation_option_overrides + self.compilation_option_overrides = {} + for key, value in compilation_option_overrides.iteritems(): + self.compilation_option_overrides[unicode(key)] = value self.cython_module_names = set() self.option_names = {} # Set up processing and handle the cython: comments. def visit_ModuleNode(self, node): options = copy.copy(Options.option_defaults) + for key, value in self.compilation_option_overrides.iteritems(): + if key in node.option_comments and node.option_comments[key] != value: + warning(node.pos, "Compiler directive differs between environment and file header; this will change " + "in Cython 0.12. See http://article.gmane.org/gmane.comp.python.cython.devel/5233", 2) + break options.update(node.option_comments) options.update(self.compilation_option_overrides) self.options = options