Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
review comments
  • Loading branch information
iritkatriel committed May 5, 2025
commit f42d42f37fa27b9ca39814d2d855c1783369c25d
1 change: 1 addition & 0 deletions Modules/arraymodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -3324,6 +3324,7 @@ array_modexec(PyObject *m)
if (PyModule_Add(m, "typecodes", typecodes) < 0) {
return -1;
}

return 0;
}

Expand Down
9 changes: 5 additions & 4 deletions Python/specialize.c
Original file line number Diff line number Diff line change
Expand Up @@ -2572,17 +2572,18 @@ binary_op_extended_specialization(PyObject *lhs, PyObject *rhs, int oparg,
}
}

if (Py_TYPE(lhs)->tp_binop_specialize != NULL) {
int ret = Py_TYPE(lhs)->tp_binop_specialize(lhs, rhs, oparg, descr);
PyTypeObject *lhs_type = Py_TYPE(lhs);
Comment thread
iritkatriel marked this conversation as resolved.
if (lhs_type->tp_binop_specialize != NULL) {
int ret = lhs_type->tp_binop_specialize(lhs, rhs, oparg, descr);
if (ret < 0) {
return -1;
}
if (ret == 1) {
if (*descr == NULL) {
PyErr_Format(
Comment thread
iritkatriel marked this conversation as resolved.
PyExc_ValueError,
"tp_binop_specialize of '%.200s' returned 1 with *descr == NULL",
Py_TYPE(lhs)->tp_name);
"tp_binop_specialize of '%T' returned 1 with *descr == NULL",
Comment thread
picnixz marked this conversation as resolved.
lhs_type->tp_name);
return -1;
}
(*descr)->oparg = oparg;
Expand Down
Loading