MCPcopy Create free account
hub / github.com/seleniumbase/SeleniumBase / run

Function run

seleniumbase/core/nest_asyncio.py:40–50  ·  view source on GitHub ↗
(main, *, debug=False)

Source from the content-addressed store, hash-verified

38
39if sys.version_info < (3, 12, 0):
40 def run(main, *, debug=False):
41 loop = asyncio.get_event_loop()
42 loop.set_debug(debug)
43 task = asyncio.ensure_future(main)
44 try:
45 return loop.run_until_complete(task)
46 finally:
47 if not task.done():
48 task.cancel()
49 with suppress(asyncio.CancelledError):
50 loop.run_until_complete(task)
51else:
52 def run(main, *, debug=False, loop_factory=None):
53 new_event_loop = False

Callers

nothing calls this directly

Calls 5

_get_event_loopFunction · 0.85
_patch_loopFunction · 0.85
get_event_loopMethod · 0.80
cancelMethod · 0.80
closeMethod · 0.80

Tested by

no test coverage detected