MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / _EvalAwaitInNewEventLoop

Class _EvalAwaitInNewEventLoop

_pydevd_bundle/pydevconsole_code.py:218–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216
217
218class _EvalAwaitInNewEventLoop(threading.Thread):
219 def __init__(self, compiled, updated_globals, updated_locals):
220 threading.Thread.__init__(self)
221 self.daemon = True
222 self._compiled = compiled
223 self._updated_globals = updated_globals
224 self._updated_locals = updated_locals
225
226 # Output
227 self.evaluated_value = None
228 self.exc = None
229
230 async def _async_func(self):
231 return await eval(self._compiled, self._updated_locals, self._updated_globals)
232
233 def run(self):
234 try:
235 import asyncio
236
237 loop = asyncio.new_event_loop()
238 asyncio.set_event_loop(loop)
239 self.evaluated_value = asyncio.run(self._async_func())
240 except:
241 self.exc = sys.exc_info()
242
243
244class InteractiveInterpreter:

Callers 2

runcodeMethod · 0.90
runcodeMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected