summaryrefslogtreecommitdiff
path: root/Cython/Compiler/FlowControl.py
diff options
context:
space:
mode:
authorVitja Makarov <vitja.makarov@gmail.com>2013-05-23 09:44:19 +0400
committerVitja Makarov <vitja.makarov@gmail.com>2013-05-23 09:44:19 +0400
commitd0627fcb5e68c038903e12ee9f84385a7a27c63c (patch)
treed56080394ca70811c76e651519a4d75f90c23f19 /Cython/Compiler/FlowControl.py
parent9b4eb5fdffba3d922ab5b7cb5a5a4c7371988fd5 (diff)
downloadcython-d0627fcb5e68c038903e12ee9f84385a7a27c63c.tar.gz
Add error_on_uninitialized option and disable it for pyregr testsuite
Diffstat (limited to 'Cython/Compiler/FlowControl.py')
-rw-r--r--Cython/Compiler/FlowControl.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/Cython/Compiler/FlowControl.py b/Cython/Compiler/FlowControl.py
index 7c812cb58..efb25b673 100644
--- a/Cython/Compiler/FlowControl.py
+++ b/Cython/Compiler/FlowControl.py
@@ -9,6 +9,7 @@ cython.declare(PyrexTypes=object, ExprNodes=object, Nodes=object,
import Builtin
import ExprNodes
import Nodes
+import Options
from PyrexTypes import py_object_type, unspecified_type
import PyrexTypes
@@ -574,7 +575,8 @@ def check_definitions(flow, compiler_directives):
if node.allow_null or entry.from_closure or entry.is_pyclass_attr:
pass # Can be uninitialized here
elif node.cf_is_null:
- if (entry.type.is_pyobject or entry.type.is_unspecified or
+ if Options.error_on_uninitialized and (
+ entry.type.is_pyobject or entry.type.is_unspecified or
entry.error_on_uninitialized):
messages.error(
node.pos,