From 4c007c7a78d6e57280deb4e4512eed9734fadbea Mon Sep 17 00:00:00 2001 From: Odelia Putterman Date: Mon, 11 Dec 2023 08:50:07 -0800 Subject: [PATCH] fix custom codefile execution syntax error --- rsudp/c_custom.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rsudp/c_custom.py b/rsudp/c_custom.py index 12b8440..6c6501f 100644 --- a/rsudp/c_custom.py +++ b/rsudp/c_custom.py @@ -91,7 +91,9 @@ def exec_code(self): printM('Executing code from file: %s' % self.codefile, sender=self.sender) try: # try to execute some code - exec(self.codefile) + with open(self.codefile, 'r') as file: + file_content = file.read() + exec(file_content) if self.testing: TEST['c_custom'][1] = True except Exception as e: