File tree 1 file changed +8
-1
lines changed 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -2598,6 +2598,7 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
2598
2598
2599
2599
TARGET (IMPORT_NAME )
2600
2600
{
2601
+ long res ;
2601
2602
w = GETITEM (names , oparg );
2602
2603
x = PyDict_GetItemString (f -> f_builtins , "__import__" );
2603
2604
if (x == NULL ) {
@@ -2608,14 +2609,20 @@ PyEval_EvalFrameEx(PyFrameObject *f, int throwflag)
2608
2609
Py_INCREF (x );
2609
2610
v = POP ();
2610
2611
u = TOP ();
2611
- if (PyInt_AsLong (u ) != -1 || PyErr_Occurred ())
2612
+ res = PyInt_AsLong (u );
2613
+ if (res != -1 || PyErr_Occurred ()) {
2614
+ if (res == -1 ) {
2615
+ assert (PyErr_Occurred ());
2616
+ PyErr_Clear ();
2617
+ }
2612
2618
w = PyTuple_Pack (5 ,
2613
2619
w ,
2614
2620
f -> f_globals ,
2615
2621
f -> f_locals == NULL ?
2616
2622
Py_None : f -> f_locals ,
2617
2623
v ,
2618
2624
u );
2625
+ }
2619
2626
else
2620
2627
w = PyTuple_Pack (4 ,
2621
2628
w ,
You can’t perform that action at this time.
0 commit comments