mirror of
https://github.com/AdaCore/cpython.git
synced 2026-02-12 12:57:15 -08:00
bpo-42990: Refactor _PyFrame_New_NoTrack() (GH-24566)
* Refactor _PyFrame_New_NoTrack() and PyFunction_NewWithQualName() code. * PyFrame_New() checks for _PyEval_BuiltinsFromGlobals() failure. * Fix a ref leak in _PyEval_BuiltinsFromGlobals() error path. * Complete PyFunction_GetModule() documentation: it returns a borrowed reference and it can return NULL. * Move _PyEval_BuiltinsFromGlobals() definition to the internal C API. * PyFunction_NewWithQualName() uses _Py_IDENTIFIER() API for the "__name__" string to make it compatible with subinterpreters.
This commit is contained in:
@@ -908,7 +908,7 @@ PyEval_EvalCode(PyObject *co, PyObject *globals, PyObject *locals)
|
||||
.fc_closure = NULL
|
||||
};
|
||||
PyThreadState *tstate = PyThreadState_GET();
|
||||
PyObject *res =_PyEval_Vector(tstate, &desc, locals, NULL, 0, NULL);
|
||||
PyObject *res = _PyEval_Vector(tstate, &desc, locals, NULL, 0, NULL);
|
||||
Py_DECREF(builtins);
|
||||
return res;
|
||||
}
|
||||
@@ -4800,8 +4800,8 @@ PyEval_EvalCodeEx(PyObject *_co, PyObject *globals, PyObject *locals,
|
||||
};
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
res = _PyEval_Vector(tstate, &constr, locals,
|
||||
allargs, argcount,
|
||||
kwnames);
|
||||
allargs, argcount,
|
||||
kwnames);
|
||||
if (kwcount) {
|
||||
Py_DECREF(kwnames);
|
||||
PyMem_Free(newargs);
|
||||
|
||||
Reference in New Issue
Block a user