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

Function _patch_policy

seleniumbase/core/nest_asyncio.py:125–139  ·  view source on GitHub ↗

Patch the policy to always return a patched loop.

()

Source from the content-addressed store, hash-verified

123
124
125def _patch_policy():
126 """Patch the policy to always return a patched loop."""
127
128 def get_event_loop(self):
129 if self._local._loop is None:
130 loop = self.new_event_loop()
131 _patch_loop(loop)
132 self.set_event_loop(loop)
133 return self._local._loop
134
135 if sys.version_info < (3, 14, 0):
136 policy = events.get_event_loop_policy()
137 else:
138 policy = events._get_event_loop_policy()
139 policy.__class__.get_event_loop = get_event_loop
140
141
142def _patch_loop(loop):

Callers 1

applyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…