Skip to content

Commit c37f863

Browse files
committed
fix: event loop for Windows
1 parent e2cbb7e commit c37f863

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

playwright/playwright.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@
2727

2828
class Playwright:
2929
def __init__(self) -> None:
30+
if sys.platform == 'win32':
31+
loop = asyncio.ProactorEventLoop()
32+
asyncio.set_event_loop(loop)
3033
self.loop = asyncio.get_event_loop()
3134
self.loop.run_until_complete(self._sync_init())
3235

0 commit comments

Comments
 (0)