move NULL out of the way in .py compilation
authorStefan Behnel <scoder@users.berlios.de>
Mon, 11 Apr 2011 20:42:38 +0000 (22:42 +0200)
committerStefan Behnel <scoder@users.berlios.de>
Mon, 11 Apr 2011 20:42:38 +0000 (22:42 +0200)
Cython/Compiler/Parsing.py
tests/run/pure_py.py

index 623af4d7220cb5b026e090f4c342edceec0742d6..8a123626090f06e1c7c13f8a05850723fb8e3312 100644 (file)
@@ -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)
index cd0b46d486cce833c619fc5dbcf2d6a5739c7d3e..e46f65f7b069cc3c7b4b7689ee9af13376471e1d 100644 (file)
@@ -1,5 +1,8 @@
 import cython
 
+NULL = 5
+_NULL = NULL
+
 def test_sizeof():
     """
     >>> test_sizeof()