From 5d7d4de366ca2b9a656179d15624754a41ed7bcf Mon Sep 17 00:00:00 2001 From: Ircama Date: Fri, 19 Feb 2021 08:33:41 +0100 Subject: [PATCH] Fix execution of commands including "emulator" variable Resolves #7 --- elm/interpreter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/elm/interpreter.py b/elm/interpreter.py index 1200019..63bd7e6 100644 --- a/elm/interpreter.py +++ b/elm/interpreter.py @@ -376,10 +376,10 @@ def postloop(self): def default(self, arg): emulator = self.emulator # ref. host_lib try: - print ( eval(arg) ) + print(eval(arg, locals())) except Exception: try: - exec(arg, globals()) + exec(arg, locals()) except Exception as e: print("Error executing command: %s" % e)