File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -475,8 +475,8 @@ validate_stmt(stmt_ty stmt)
475475 case Import_kind :
476476 return validate_nonempty_seq (stmt -> v .Import .names , "names" , "Import" );
477477 case ImportFrom_kind :
478- if (stmt -> v .ImportFrom .level < -1 ) {
479- PyErr_SetString (PyExc_ValueError , "ImportFrom level less than -1 " );
478+ if (stmt -> v .ImportFrom .level < 0 ) {
479+ PyErr_SetString (PyExc_ValueError , "Negative ImportFrom level" );
480480 return 0 ;
481481 }
482482 return validate_nonempty_seq (stmt -> v .ImportFrom .names , "names" , "ImportFrom" );
Original file line number Diff line number Diff line change @@ -2820,21 +2820,13 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
28202820 Py_INCREF (func );
28212821 from = POP ();
28222822 level = TOP ();
2823- if (PyLong_AsLong (level ) != -1 || PyErr_Occurred ())
2824- args = PyTuple_Pack (5 ,
2823+ args = PyTuple_Pack (5 ,
28252824 name ,
28262825 f -> f_globals ,
28272826 f -> f_locals == NULL ?
28282827 Py_None : f -> f_locals ,
28292828 from ,
28302829 level );
2831- else
2832- args = PyTuple_Pack (4 ,
2833- name ,
2834- f -> f_globals ,
2835- f -> f_locals == NULL ?
2836- Py_None : f -> f_locals ,
2837- from );
28382830 Py_DECREF (level );
28392831 Py_DECREF (from );
28402832 if (args == NULL ) {
You can’t perform that action at this time.
0 commit comments