Skip to content

Commit 1cdfcfc

Browse files
authored
bpo-35337: Fix gettmarg(): use PyStructSequence_GET_ITEM() (GH-10765)
PyStructSequence_GET_ITEM() must be used instead of PyTuple_GET_ITEM() on a StructTimeType.
1 parent 54ba556 commit 1cdfcfc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/timemodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ gettmarg(PyObject *args, struct tm *p, const char *format)
568568
#ifdef HAVE_STRUCT_TM_TM_ZONE
569569
if (Py_TYPE(args) == &StructTimeType) {
570570
PyObject *item;
571-
item = PyTuple_GET_ITEM(args, 9);
571+
item = PyStructSequence_GET_ITEM(args, 9);
572572
if (item != Py_None) {
573573
p->tm_zone = (char *)PyUnicode_AsUTF8(item);
574574
if (p->tm_zone == NULL) {
@@ -589,7 +589,7 @@ gettmarg(PyObject *args, struct tm *p, const char *format)
589589
}
590590
#endif
591591
}
592-
item = PyTuple_GET_ITEM(args, 10);
592+
item = PyStructSequence_GET_ITEM(args, 10);
593593
if (item != Py_None) {
594594
p->tm_gmtoff = PyLong_AsLong(item);
595595
if (PyErr_Occurred())

0 commit comments

Comments
 (0)