diff --git a/src/pya/pya/pya.cc b/src/pya/pya/pya.cc index 39a400f2c..53d0d9496 100644 --- a/src/pya/pya/pya.cc +++ b/src/pya/pya/pya.cc @@ -888,10 +888,12 @@ gsi::Console *PythonInterpreter::current_console () const void PythonInterpreter::begin_execution () { - m_file_id_map.clear (); m_block_exceptions = false; - if (m_current_exec_level++ == 0 && mp_current_exec_handler) { - mp_current_exec_handler->start_exec (this); + if (m_current_exec_level++ == 0) { + m_file_id_map.clear (); + if (mp_current_exec_handler) { + mp_current_exec_handler->start_exec (this); + } } } diff --git a/src/rba/rba/rba.cc b/src/rba/rba/rba.cc index b3327b218..27af10ed0 100644 --- a/src/rba/rba/rba.cc +++ b/src/rba/rba/rba.cc @@ -2486,9 +2486,11 @@ RubyInterpreter::begin_exec () { d->exit_on_next = false; d->block_exceptions = false; - d->file_id_map.clear (); - if (d->current_exec_level++ == 0 && d->current_exec_handler) { - d->current_exec_handler->start_exec (this); + if (d->current_exec_level++ == 0) { + d->file_id_map.clear (); + if (d->current_exec_handler) { + d->current_exec_handler->start_exec (this); + } } }