From: Stefan Behnel Date: Mon, 11 Apr 2011 20:42:38 +0000 (+0200) Subject: move NULL out of the way in .py compilation X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=c62148d06d62e2471e73ae6ff6beabb7c42bd926;p=cython.git move NULL out of the way in .py compilation --- 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()