summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wiebe <mwwiebe@gmail.com>2011-09-17 16:55:37 -0700
committerCharles Harris <charlesr.harris@gmail.com>2011-10-01 09:43:09 -0600
commitd81a85cbdbd8d59df8b8166badaf369cb2f03ff9 (patch)
treeb5b02430673a625b26b95fbd9655f59b97468b41
parent231b96a460b86f6f8867be6f5b8261fbd3784ebe (diff)
downloadnumpy-d81a85cbdbd8d59df8b8166badaf369cb2f03ff9.tar.gz
BUG: Add %lld exception for Python 3.1 as well
-rw-r--r--numpy/core/src/multiarray/scalartypes.c.src20
1 files changed, 14 insertions, 6 deletions
diff --git a/numpy/core/src/multiarray/scalartypes.c.src b/numpy/core/src/multiarray/scalartypes.c.src
index b739e376f..a3d1161dd 100644
--- a/numpy/core/src/multiarray/scalartypes.c.src
+++ b/numpy/core/src/multiarray/scalartypes.c.src
@@ -681,9 +681,13 @@ timedeltatype_repr(PyObject *self)
ret = PyUString_FromString("numpy.timedelta64('NaT'");
}
else {
- /* Can't use "%lld" in Python < 2.7, or if HAVE_LONG_LONG is not
- * defined */
-#if defined(HAVE_LONG_LONG) && (PY_VERSION_HEX >= 0x02070000)
+ /*
+ * Can't use "%lld" in Python < 2.7, Python3 < 3.2,
+ * or if HAVE_LONG_LONG is not defined
+ */
+#if defined(HAVE_LONG_LONG) && \
+ ((PY_VERSION_HEX >= 0x02070000 && PY_VERSION_HEX < 0x03000000) || \
+ (PY_VERSION_HEX >= 0x03020000))
ret = PyUString_FromFormat("numpy.timedelta64(%lld",
(long long)scal->obval);
#else
@@ -791,9 +795,13 @@ timedeltatype_str(PyObject *self)
ret = PyUString_FromString("NaT");
}
else {
- /* Can't use "%lld" in Python < 2.7, or if HAVE_LONG_LONG is not
- * defined */
-#if defined(HAVE_LONG_LONG) && (PY_VERSION_HEX >= 0x02070000)
+ /*
+ * Can't use "%lld" in Python < 2.7, Python3 < 3.2,
+ * or if HAVE_LONG_LONG is not defined
+ */
+#if defined(HAVE_LONG_LONG) && \
+ ((PY_VERSION_HEX >= 0x02070000 && PY_VERSION_HEX < 0x03000000) || \
+ (PY_VERSION_HEX >= 0x03020000))
ret = PyUString_FromFormat("%lld ",
(long long)(scal->obval * scal->obmeta.num));
#else