mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-74929: Implement PEP 667 (GH-115153)
This commit is contained in:
parent
1ab6356ebe
commit
b034f14a4b
19 changed files with 921 additions and 257 deletions
|
@ -123,18 +123,15 @@ static PyObject *
|
|||
import_star(PyThreadState* tstate, PyObject *from)
|
||||
{
|
||||
_PyInterpreterFrame *frame = tstate->current_frame;
|
||||
if (_PyFrame_FastToLocalsWithError(frame) < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
PyObject *locals = frame->f_locals;
|
||||
PyObject *locals = _PyFrame_GetLocals(frame);
|
||||
if (locals == NULL) {
|
||||
_PyErr_SetString(tstate, PyExc_SystemError,
|
||||
"no locals found during 'import *'");
|
||||
return NULL;
|
||||
}
|
||||
int err = import_all_from(tstate, locals, from);
|
||||
_PyFrame_LocalsToFast(frame, 0);
|
||||
Py_DECREF(locals);
|
||||
if (err < 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue