summaryrefslogtreecommitdiffstats
path: root/Modules/timemodule.c
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2018-11-28 14:19:51 (GMT)
committerGitHub <noreply@github.com>2018-11-28 14:19:51 (GMT)
commit1cdfcfc9843d35ab2cb87387d3a79b2c8a585a38 (patch)
tree4bc724712a4062a0430b12ed186832df4544072a /Modules/timemodule.c
parent54ba556c6c7d8fd5504dc142c2e773890c55a774 (diff)
downloadcpython-1cdfcfc9843d35ab2cb87387d3a79b2c8a585a38.zip
cpython-1cdfcfc9843d35ab2cb87387d3a79b2c8a585a38.tar.gz
cpython-1cdfcfc9843d35ab2cb87387d3a79b2c8a585a38.tar.bz2
bpo-35337: Fix gettmarg(): use PyStructSequence_GET_ITEM() (GH-10765)
PyStructSequence_GET_ITEM() must be used instead of PyTuple_GET_ITEM() on a StructTimeType.
Diffstat (limited to 'Modules/timemodule.c')
-rw-r--r--Modules/timemodule.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/Modules/timemodule.c b/Modules/timemodule.c
index c3ecd80..55b82d7 100644
--- a/Modules/timemodule.c
+++ b/Modules/timemodule.c
@@ -568,7 +568,7 @@ gettmarg(PyObject *args, struct tm *p, const char *format)
#ifdef HAVE_STRUCT_TM_TM_ZONE
if (Py_TYPE(args) == &StructTimeType) {
PyObject *item;
- item = PyTuple_GET_ITEM(args, 9);
+ item = PyStructSequence_GET_ITEM(args, 9);
if (item != Py_None) {
p->tm_zone = (char *)PyUnicode_AsUTF8(item);
if (p->tm_zone == NULL) {
@@ -589,7 +589,7 @@ gettmarg(PyObject *args, struct tm *p, const char *format)
}
#endif
}
- item = PyTuple_GET_ITEM(args, 10);
+ item = PyStructSequence_GET_ITEM(args, 10);
if (item != Py_None) {
p->tm_gmtoff = PyLong_AsLong(item);
if (PyErr_Occurred())