exec
PYL-W01221206 is used by the loaders and environment to create a template object.
1207 """
1208 namespace = {"environment": environment, "__file__": code.co_filename}
1209 exec(code, namespace)1210 rv = cls._from_namespace(environment, namespace, globals)
1211 rv._uptodate = uptodate
1212 return rv
142 # Execute the new code, which is guaranteed to raise, and return
143 # the new traceback without this frame.
144 try:
145 exec(code, globals, locals)146 except BaseException:
147 return sys.exc_info()[2].tb_next # type: ignore
148
Usage of exec
function is strongly discouraged, since it opens up possibilities of unauthorized code execution if the statements are not escaped properly. Read more on why should exec
be avoided here.