From 4305ac87f3cf673147274a7b26f1a67845e3e3bd Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Wed, 15 Apr 2009 16:15:37 +0200 Subject: [PATCH] Add warning in situations where command line directive behaviour will change in 0.12 --- Cython/Compiler/ParseTreeTransforms.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- 2.26.2