summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ExprNodes.py
diff options
context:
space:
mode:
Diffstat (limited to 'Cython/Compiler/ExprNodes.py')
-rw-r--r--Cython/Compiler/ExprNodes.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
index 2c5d70936..746e1772b 100644
--- a/Cython/Compiler/ExprNodes.py
+++ b/Cython/Compiler/ExprNodes.py
@@ -11779,6 +11779,14 @@ class ModNode(DivNode):
class PowNode(NumBinopNode):
# '**' operator.
+ def analyse_types(self, env):
+ if not env.directives['cpow']:
+ # Note - the check here won't catch cpow directives that don't use '**'
+ # but that's probably OK for a placeholder forward compatibility directive
+ error(self.pos, "The 'cpow' directive is provided for forward compatibility "
+ "and must be True")
+ return super(PowNode, self).analyse_types(env)
+
def analyse_c_operation(self, env):
NumBinopNode.analyse_c_operation(self, env)
if self.type.is_complex: