8000 Fix test_async and test_stdio_handling by hoodmane · Pull Request #1319 · pyscript/pyscript · GitHub
[go: up one dir, main page]

Skip to content

Fix test_async and test_stdio_handling #1319

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 30, 2023
Prev Previous commit
Next Next commit
Fix event loop initialization
  • Loading branch information
hoodmane committed Mar 30, 2023
commit 8945fc7cbd57be05e39b6b7994bd6ccf605a85a2
8 changes: 7 additions & 1 deletion pyscriptjs/src/python/pyscript/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,13 @@ def start_(self):
self.deferred_handles = []


_LOOP = _PyscriptWebLoop()
def _init_loop():
global _LOOP
orig_loop = asyncio.get_event_loop()
_LOOP = _PyscriptWebLoop()
asyncio._set_running_loop(orig_loop)

_init_loop()


@contextmanager
Expand Down
0