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

Method _exec_await

Lib/pdb.py:899–911  ·  view source on GitHub ↗

Run source code that contains await by playing with async shim frame

(self, source, globals, locals)

Source from the content-addressed store, hash-verified

897 return True
898
899 def _exec_await(self, source, globals, locals):
900 """ Run source code that contains await by playing with async shim frame"""
901 # Put the source in an async function
902 source_async = (
903 "async def __pdb_await():\n" +
904 textwrap.indent(source, " ") + '\n' +
905 " __pdb_locals.update(locals())"
906 )
907 ns = globals | locals
908 # We use __pdb_locals to do write back
909 ns["__pdb_locals"] = locals
910 exec(source_async, ns)
911 self.async_awaitable = ns["__pdb_await"]()
912
913 def _read_code(self, line):
914 buffer = line

Callers 1

defaultMethod · 0.95

Calls 1

indentMethod · 0.45

Tested by

no test coverage detected