Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 138f465

Browse files
committed
Add a separate NEWS entry for a change to PyObject_CallMethod in the PEP 380 patch, and make the private CallMethod variants consistent with the public one
1 parent 76e1bb0 commit 138f465

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2449,6 +2449,9 @@ Library
24492449
C-API
24502450
-----
24512451

2452+
- PyObject_CallMethod now passes along any underlying AttributeError from
2453+
PyObject_GetAttr, instead of replacing it with something less informative
2454+
24522455
- Issue #10913: Deprecate misleading functions PyEval_AcquireLock() and
24532456
PyEval_ReleaseLock(). The thread-state aware APIs should be used instead.
24542457

Objects/abstract.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2288,7 +2288,6 @@ _PyObject_CallMethodId(PyObject *o, _Py_Identifier *name, char *format, ...)
22882288

22892289
func = _PyObject_GetAttrId(o, name);
22902290
if (func == NULL) {
2291-
PyErr_SetString(PyExc_AttributeError, name->string);
22922291
return 0;
22932292
}
22942293

@@ -2330,7 +2329,6 @@ _PyObject_CallMethodId_SizeT(PyObject *o, _Py_Identifier *name, char *format, ..
23302329

23312330
func = _PyObject_GetAttrId(o, name);
23322331
if (func == NULL) {
2333-
PyErr_SetString(PyExc_AttributeError, name->string);
23342332
return NULL;
23352333
}
23362334
va_start(va, format);

0 commit comments

Comments
 (0)