bpo-35337: Fix gettmarg(): use PyStructSequence_GET_ITEM() (GH-10765) · python/cpython@1cdfcfc (original) (raw)

Original file line number Diff line number Diff line change
@@ -568,7 +568,7 @@ gettmarg(PyObject *args, struct tm *p, const char *format)
568 568 #ifdef HAVE_STRUCT_TM_TM_ZONE
569 569 if (Py_TYPE(args) == &StructTimeType) {
570 570 PyObject *item;
571 -item = PyTuple_GET_ITEM(args, 9);
571 +item = PyStructSequence_GET_ITEM(args, 9);
572 572 if (item != Py_None) {
573 573 p->tm_zone = (char *)PyUnicode_AsUTF8(item);
574 574 if (p->tm_zone == NULL) {
@@ -589,7 +589,7 @@ gettmarg(PyObject *args, struct tm *p, const char *format)
589 589 }
590 590 #endif
591 591 }
592 -item = PyTuple_GET_ITEM(args, 10);
592 +item = PyStructSequence_GET_ITEM(args, 10);
593 593 if (item != Py_None) {
594 594 p->tm_gmtoff = PyLong_AsLong(item);
595 595 if (PyErr_Occurred())