-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
gh-126353: remove implicit creation of loop from get_event_loop
#126354
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
Changes from 9 commits
496eee6
3c9075d
9f79f73
102475a
516f097
1214f07
b84ded1
29caae3
f6c1588
04d9667
6687913
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -576,6 +576,11 @@ asyncio | |
|
|
||
| (Contributed by Kumar Aditya in :gh:`120804`.) | ||
|
|
||
| * Removed implicit creation of event loop by :func:`asyncio.get_event_loop`. | ||
| It now raises a :exc:`RuntimeError` if there is no current event loop | ||
kumaraditya303 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| (Contributed by Kumar Aditya in :gh:`126353`.) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please mention what should be used instead? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new_event_loop is not correct, it should be asyncio.run or asyncio.Runner Worst case it would be asyncio.EventLoop, new_event_loop uses the policy system |
||
|
|
||
|
|
||
| collections.abc | ||
| --------------- | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -924,7 +924,7 @@ def test_python_gil(self): | |
| self.assertEqual(proc.stderr, '') | ||
|
|
||
| def test_python_asyncio_debug(self): | ||
| code = "import asyncio; print(asyncio.get_event_loop().get_debug())" | ||
| code = "import asyncio; print(asyncio.new_event_loop().get_debug())" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this needs a |
||
| rc, out, err = assert_python_ok('-c', code, PYTHONASYNCIODEBUG='1') | ||
| self.assertIn(b'True', out) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| :func:`asyncio.get_event_loop` now does not implicitly creates an event loop. | ||
| It now raises a :exc:`RuntimeError` if there is no set event loop. Patch by Kumar Aditya. |
Uh oh!
There was an error while loading. Please reload this page.