[apps/code] Fix circular importation in the variable box

Scenario (crashed only on the calculator):

script1.py
from script2 import *
a=1

script2.py
from script1 import *
b=2
This commit is contained in:
Léa Saviot
2020-05-28 14:59:30 +02:00
committed by Émilie Feral
parent 6819041c1d
commit 1635f6132b
6 changed files with 80 additions and 21 deletions

View File

@@ -52,6 +52,7 @@ bool ConsoleController::loadPythonEnvironment() {
m_pythonDelegate->initPythonWithUser(this);
MicroPython::registerScriptProvider(m_scriptStore);
m_importScriptsWhenViewAppears = m_autoImportScripts;
m_scriptStore->clearFetchInformation();
}
return true;
}
@@ -60,7 +61,6 @@ void ConsoleController::unloadPythonEnvironment() {
if (!m_pythonDelegate->isPythonUser(nullptr)) {
m_consoleStore.startNewSession();
m_pythonDelegate->deinitPython();
m_scriptStore->clearFetchInformation();
}
}