compile fix for test under PyPy
authorStefan Behnel <stefan_ml@behnel.de>
Mon, 9 Jul 2012 19:43:25 +0000 (21:43 +0200)
committerStefan Behnel <stefan_ml@behnel.de>
Mon, 9 Jul 2012 19:43:25 +0000 (21:43 +0200)
Cython/Compiler/ExprNodes.py

index 7d0634b..c79cb5e 100755 (executable)
@@ -10014,12 +10014,19 @@ static int __Pyx_cdivision_warning(const char *, int); /* proto */
 """,
 impl="""
 static int __Pyx_cdivision_warning(const char *filename, int lineno) {
+#if CYTHON_COMPILING_IN_PYPY
+    filename++; // avoid compiler warnings
+    lineno++;
+    return PyErr_Warn(PyExc_RuntimeWarning,
+                     "division with oppositely signed operands, C and Python semantics differ");
+#else
     return PyErr_WarnExplicit(PyExc_RuntimeWarning,
                               "division with oppositely signed operands, C and Python semantics differ",
                               filename,
                               lineno,
                               __Pyx_MODULE_NAME,
                               NULL);
+#endif
 }
 """)