summaryrefslogtreecommitdiff
path: root/Cython/Compiler/ModuleNode.py
diff options
context:
space:
mode:
authorRobert Bradshaw <robertwb@math.washington.edu>2008-07-15 21:56:39 -0700
committerRobert Bradshaw <robertwb@math.washington.edu>2008-07-15 21:56:39 -0700
commit1cae03c08404f98682272f3b9467aa82b45099db (patch)
treebad778e948371a435f52c2d12d391286d0b7ff75 /Cython/Compiler/ModuleNode.py
parent44a8c73d43d573c2f5c7effd7aa22d530cb58b9c (diff)
downloadcython-1cae03c08404f98682272f3b9467aa82b45099db.tar.gz
future division
Diffstat (limited to 'Cython/Compiler/ModuleNode.py')
-rw-r--r--Cython/Compiler/ModuleNode.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Cython/Compiler/ModuleNode.py b/Cython/Compiler/ModuleNode.py
index 3dbdf90db..68394529e 100644
--- a/Cython/Compiler/ModuleNode.py
+++ b/Cython/Compiler/ModuleNode.py
@@ -5,6 +5,7 @@
import os, time
from cStringIO import StringIO
from PyrexTypes import CPtrType
+import Future
try:
set
@@ -467,8 +468,12 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln(" #define PyInt_AsSsize_t PyLong_AsSsize_t")
code.putln(" #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask")
code.putln(" #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask")
- code.putln(" #define PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)")
+ code.putln(" #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)")
code.putln("#else")
+ if Future.division in env.context.future_directives:
+ code.putln(" #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)")
+ else:
+ code.putln(" #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)")
code.putln(" #define PyBytes_Type PyString_Type")
code.putln("#endif")