MCPcopy Index your code
hub / github.com/python/cpython / exec

Method exec

Lib/concurrent/interpreters/__init__.py:197–217  ·  view source on GitHub ↗

Run the given source code in the interpreter. This is essentially the same as calling the builtin "exec" with this interpreter, using the __dict__ of its __main__ module as both globals and locals. There is no return value. If the code raises an unhandled e

(self, code, /)

Source from the content-addressed store, hash-verified

195 _interpreters.set___main___attrs(self._id, ns, restrict=True)
196
197 def exec(self, code, /):
198 """Run the given source code in the interpreter.
199
200 This is essentially the same as calling the builtin "exec"
201 with this interpreter, using the __dict__ of its __main__
202 module as both globals and locals.
203
204 There is no return value.
205
206 If the code raises an unhandled exception then an ExecutionFailed
207 exception is raised, which summarizes the unhandled exception.
208 The actual exception is discarded because objects cannot be
209 shared between interpreters.
210
211 This blocks the current Python thread until done. During
212 that time, the previous interpreter is allowed to run
213 in other threads.
214 """
215 excinfo = _interpreters.exec(self._id, code, restrict=True)
216 if excinfo is not None:
217 raise ExecutionFailed(excinfo)
218
219 def _call(self, callable, args, kwargs):
220 res, excinfo = _interpreters.call(self._id, callable, args, kwargs, restrict=True)

Callers 15

zeFunction · 0.80
XrFunction · 0.80
JcFunction · 0.80
hvFunction · 0.80
wvFunction · 0.80
MvFunction · 0.80
TvFunction · 0.80
AvFunction · 0.80
SvFunction · 0.80
EvFunction · 0.80
NvFunction · 0.80
kvFunction · 0.80

Calls 1

ExecutionFailedClass · 0.85