Safe_exec not reading globals from globals_dict

Hi all,
I’m attempting to use safe_exec from edx-codejail=3.3.3 to sandbox some unsafe code. The code should have access to a limited number of globals, which I intend to pass via the globals_dict argument. However, codejail fails to read the globals dictionary, and yields a NameError instead. Below is a minimal example, which fails to run for me:

import codejail.safe_exec

codejail.safe_exec.safe_exec("p('hello')", {'p': print})

This is, of course, a massive simplification of what I’m attempting to do, but can anyone see what’s wrong with my approach?


Never mind, apparently per json_safe, functions aren’t allowed in the globals dict.