8000 gh-93453: No longer create an event loop in get_event_loop() by serhiy-storchaka · Pull Request #98440 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-93453: No longer create an event loop in get_event_loop() #98440

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 6 commits into from
Dec 6, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test_fork_not_share_event_loop.
  • Loading branch information
serhiy-storchaka committed Nov 30, 2022
commit 380c158c6a0d981c8d43983dbfb48493591e21a2
8 changes: 5 additions & 3 deletions Lib/test/test_asyncio/test_unix_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -1885,13 +1885,15 @@ async def test_fork_not_share_event_loop(self):
# child
try:
loop = asyncio.get_event_loop_policy().get_event_loop()
os.write(w, str(id(loop)).encode())
except RuntimeError:
os.write(w, b'NO LOOP')
except:
os.write(w, b'ERROR:' + ascii(sys.exc_info()).encode())
finally:
os._exit(0)
else:
# parent
child_loop = int(os.read(r, 100).decode())
self.assertNotEqual(child_loop, id(loop))
self.assertEqual(os.read(r, 100), b'NO LOOP')
wait_process(pid, exitcode=0)

@hashlib_helper.requires_hashdigest('md5')
Expand Down
0