Skip to content

Commit eaf508b

Browse files
committed
Update Python inlined files: 3.12.7 (4.5)
1 parent bcdd593 commit eaf508b

File tree

3 files changed

+1134
-153
lines changed

3 files changed

+1134
-153
lines changed

graalpython/com.oracle.graal.python.cext/src/abstract.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -526,18 +526,12 @@ _Py_add_one_to_index_C(int nd, Py_ssize_t *index, const Py_ssize_t *shape)
526526
Py_ssize_t
527527
PyBuffer_SizeFromFormat(const char *format)
528528
{
529-
PyObject *structmodule = NULL;
530529
PyObject *calcsize = NULL;
531530
PyObject *res = NULL;
532531
PyObject *fmt = NULL;
533532
Py_ssize_t itemsize = -1;
534533

535-
structmodule = PyImport_ImportModule("struct");
536-
if (structmodule == NULL) {
537-
return itemsize;
538-
}
539-
540-
calcsize = PyObject_GetAttrString(structmodule, "calcsize");
534+
calcsize = _PyImport_GetModuleAttrString("struct", "calcsize");
541535
if (calcsize == NULL) {
542536
goto done;
543537
}
@@ -558,7 +552,6 @@ PyBuffer_SizeFromFormat(const char *format)
558552
}
559553

560554
done:
561-
Py_DECREF(structmodule);
562555
Py_XDECREF(calcsize);
563556
Py_XDECREF(fmt);
564557
Py_XDECREF(res);

0 commit comments

Comments
 (0)