mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #27352: Correct the validation of the ImportFrom AST node and simplify
the implementation of the IMPORT_NAME opcode.
This commit is contained in:
parent
44a98b6bf3
commit
fbd1523525
2 changed files with 3 additions and 11 deletions
|
@ -2820,21 +2820,13 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
|
|||
Py_INCREF(func);
|
||||
from = POP();
|
||||
level = TOP();
|
||||
if (PyLong_AsLong(level) != -1 || PyErr_Occurred())
|
||||
args = PyTuple_Pack(5,
|
||||
args = PyTuple_Pack(5,
|
||||
name,
|
||||
f->f_globals,
|
||||
f->f_locals == NULL ?
|
||||
Py_None : f->f_locals,
|
||||
from,
|
||||
level);
|
||||
else
|
||||
args = PyTuple_Pack(4,
|
||||
name,
|
||||
f->f_globals,
|
||||
f->f_locals == NULL ?
|
||||
Py_None : f->f_locals,
|
||||
from);
|
||||
Py_DECREF(level);
|
||||
Py_DECREF(from);
|
||||
if (args == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue