Skip to content
Snippets Groups Projects
Commit b497ea1e authored by Andreas Klöckner's avatar Andreas Klöckner
Browse files

Add support for debugging of generated code

parent 08caf3a1
Branches
Tags
No related merge requests found
......@@ -82,6 +82,9 @@ class PythonFunctionGenerator(PythonCodeGenerator):
def get_function(self):
result_dict = {}
exec(compile(self.get(), "<generated function %s>" % self.name, "exec"),
source_text = self.get()
exec(compile(source_text, "<generated function %s>" % self.name, "exec"),
result_dict)
return result_dict[self.name]
func = result_dict[self.name]
result_dict["_MODULE_SOURCE_CODE"] = source_text
return func
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment