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

Class _EvalAwaitInNewEventLoop

_pydevd_bundle/pydevd_vars.py:419–441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417
418
419class _EvalAwaitInNewEventLoop(PyDBDaemonThread):
420 def __init__(self, py_db, compiled, updated_globals, updated_locals):
421 PyDBDaemonThread.__init__(self, py_db)
422 self._compiled = compiled
423 self._updated_globals = updated_globals
424 self._updated_locals = updated_locals
425
426 # Output
427 self.evaluated_value = None
428 self.exc = None
429
430 async def _async_func(self):
431 return await eval(self._compiled, self._updated_locals, self._updated_globals)
432
433 def _on_run(self):
434 try:
435 import asyncio
436
437 loop = asyncio.new_event_loop()
438 asyncio.set_event_loop(loop)
439 self.evaluated_value = asyncio.run(self._async_func())
440 except:
441 self.exc = sys.exc_info()
442
443
444@_evaluate_with_timeouts

Callers 2

eval_in_contextFunction · 0.70
evaluate_expressionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected