| 417 | |
| 418 | |
| 419 | class _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 |
no outgoing calls
no test coverage detected