mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-22 22:53:04 +00:00
m1n1.hv: Properly update current shell globals after run_script()
Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
parent
a714c74e1a
commit
035aa486d6
1 changed files with 3 additions and 1 deletions
|
@ -1145,7 +1145,9 @@ class HV(Reloadable):
|
||||||
self.iface.dev.write(b"!")
|
self.iface.dev.write(b"!")
|
||||||
|
|
||||||
def run_script(self, path):
|
def run_script(self, path):
|
||||||
self.shell_locals = runpy.run_path(path, init_globals=self.shell_locals, run_name="<hv_script>")
|
new_locals = runpy.run_path(path, init_globals=self.shell_locals, run_name="<hv_script>")
|
||||||
|
self.shell_locals.clear()
|
||||||
|
self.shell_locals.update(new_locals)
|
||||||
|
|
||||||
def run_code(self, code):
|
def run_code(self, code):
|
||||||
exec(code, self.shell_locals)
|
exec(code, self.shell_locals)
|
||||||
|
|
Loading…
Reference in a new issue