[Python-checkins] gh-95878: Fix format char in datetime CAPI tests (GH-95879)

miss-islington webhook-mailer at python.org
Thu Aug 11 14:07:21 EDT 2022


https://github.com/python/cpython/commit/9c04e25308ef2bfa44f2cca0b56bfe46be1f6b1b
commit: 9c04e25308ef2bfa44f2cca0b56bfe46be1f6b1b
branch: 3.10
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-08-11T11:06:48-07:00
summary:

gh-95878: Fix format char in datetime CAPI tests (GH-95879)

(cherry picked from commit 8b34e914bba2ccd6ae39609410db49d0beb19cb1)

Co-authored-by: Christian Heimes <christian at python.org>

files:
M Modules/_testcapimodule.c

diff --git a/Modules/_testcapimodule.c b/Modules/_testcapimodule.c
index 7cce4e5a3f3b..9f74c9976911 100644
--- a/Modules/_testcapimodule.c
+++ b/Modules/_testcapimodule.c
@@ -2800,7 +2800,7 @@ test_PyDateTime_GET(PyObject *self, PyObject *obj)
     month = PyDateTime_GET_MONTH(obj);
     day = PyDateTime_GET_DAY(obj);
 
-    return Py_BuildValue("(lll)", year, month, day);
+    return Py_BuildValue("(iii)", year, month, day);
 }
 
 static PyObject *
@@ -2814,7 +2814,7 @@ test_PyDateTime_DATE_GET(PyObject *self, PyObject *obj)
     microsecond = PyDateTime_DATE_GET_MICROSECOND(obj);
     PyObject *tzinfo = PyDateTime_DATE_GET_TZINFO(obj);
 
-    return Py_BuildValue("(llllO)", hour, minute, second, microsecond, tzinfo);
+    return Py_BuildValue("(iiiiO)", hour, minute, second, microsecond, tzinfo);
 }
 
 static PyObject *
@@ -2828,7 +2828,7 @@ test_PyDateTime_TIME_GET(PyObject *self, PyObject *obj)
     microsecond = PyDateTime_TIME_GET_MICROSECOND(obj);
     PyObject *tzinfo = PyDateTime_TIME_GET_TZINFO(obj);
 
-    return Py_BuildValue("(llllO)", hour, minute, second, microsecond, tzinfo);
+    return Py_BuildValue("(iiiiO)", hour, minute, second, microsecond, tzinfo);
 }
 
 static PyObject *
@@ -2840,7 +2840,7 @@ test_PyDateTime_DELTA_GET(PyObject *self, PyObject *obj)
     seconds = PyDateTime_DELTA_GET_SECONDS(obj);
     microseconds = PyDateTime_DELTA_GET_MICROSECONDS(obj);
 
-    return Py_BuildValue("(lll)", days, seconds, microseconds);
+    return Py_BuildValue("(iii)", days, seconds, microseconds);
 }
 
 /* test_thread_state spawns a thread of its own, and that thread releases



More information about the Python-checkins mailing list