From c62148d06d62e2471e73ae6ff6beabb7c42bd926 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Mon, 11 Apr 2011 22:42:38 +0200 Subject: [PATCH] move NULL out of the way in .py compilation --- Cython/Compiler/Parsing.py | 2 +- tests/run/pure_py.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Cython/Compiler/Parsing.py b/Cython/Compiler/Parsing.py index 623af4d7..8a123626 100644 --- a/Cython/Compiler/Parsing.py +++ b/Cython/Compiler/Parsing.py @@ -615,7 +615,7 @@ def p_atom(s): return ExprNodes.BoolNode(pos, value=True) elif name == "False": return ExprNodes.BoolNode(pos, value=False) - elif name == "NULL": + elif name == "NULL" and not s.in_python_file: return ExprNodes.NullNode(pos) else: return p_name(s, name) diff --git a/tests/run/pure_py.py b/tests/run/pure_py.py index cd0b46d4..e46f65f7 100644 --- a/tests/run/pure_py.py +++ b/tests/run/pure_py.py @@ -1,5 +1,8 @@ import cython +NULL = 5 +_NULL = NULL + def test_sizeof(): """ >>> test_sizeof() -- 2.26.2