From c39b59523b7d3f2c200b6ff50a429250dc340b79 Mon Sep 17 00:00:00 2001
From: Mark Florisson <markflorisson88@gmail.com>
Date: Wed, 16 Mar 2011 13:27:13 +0100
Subject: [PATCH] Issue an error for invalid directives in 'with' statements

---
 Cython/Compiler/ParseTreeTransforms.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/Cython/Compiler/ParseTreeTransforms.py b/Cython/Compiler/ParseTreeTransforms.py
index 0edb9bb..63b96fa 100644
--- a/Cython/Compiler/ParseTreeTransforms.py
+++ b/Cython/Compiler/ParseTreeTransforms.py
@@ -596,6 +596,8 @@ class InterpretCompilerDirectives(CythonTransform, SkipDeclarations):
                                         'is not allowed in %s scope' % (directive, scope)))
             return False
         else:
+            if directive not in Options.directive_defaults:
+                error(pos, "Invalid directive.")
             return True
 
     # Set up processing and handle the cython: comments.
-- 
1.7.4.1

