|
25 | 25 | from urllib.parse import urlparse |
26 | 26 |
|
27 | 27 | from autobahn.twisted.websocket import WebSocketServerFactory, WebSocketServerProtocol |
28 | | -from greenlet import greenlet |
29 | 28 | from OpenSSL import crypto |
30 | 29 | from twisted.internet import reactor, ssl |
31 | 30 | from twisted.internet.protocol import ClientFactory |
32 | 31 | from twisted.web import http |
33 | 32 |
|
34 | 33 | from playwright._impl._path_utils import get_file_dirname |
35 | | -from playwright.sync_api._context_manager import dispatcher_fiber |
36 | 34 |
|
37 | 35 | _dirname = get_file_dirname() |
38 | 36 |
|
@@ -164,17 +162,13 @@ def expect_request( |
164 | 162 | ) -> Generator[ExpectResponse[http.Request], None, None]: |
165 | 163 | future = asyncio.create_task(self.wait_for_request(path)) |
166 | 164 |
|
167 | | - g_self = greenlet.getcurrent() |
168 | 165 | cb_wrapper: ExpectResponse[http.Request] = ExpectResponse() |
169 | 166 |
|
170 | 167 | def done_cb(task: asyncio.Task) -> None: |
171 | 168 | cb_wrapper._value = future.result() |
172 | | - g_self.switch() |
173 | 169 |
|
174 | 170 | future.add_done_callback(done_cb) |
175 | 171 | yield cb_wrapper |
176 | | - while not future.done(): |
177 | | - dispatcher_fiber.switch() |
178 | 172 |
|
179 | 173 | def set_auth(self, path: str, username: str, password: str) -> None: |
180 | 174 | self.auth[path] = (username, password) |
|
0 commit comments