[3.11] gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created by serhiy-storchaka · Pull Request #99949 · python/cpython · GitHub
Skip to content

[3.11] gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created - #99949

Merged
ambv merged 6 commits into
python:3.11from
serhiy-storchaka:asyncio-get_event_loop2-3.11
Dec 6, 2022
Merged

[3.11] gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created#99949
ambv merged 6 commits into
python:3.11from
serhiy-storchaka:asyncio-get_event_loop2-3.11

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Dec 2, 2022

Copy link
Copy Markdown
Member

It no longer emits a deprecation warning if the current event loop was set.

…op when a new event loop is created

It no longer emits a deprecation warning if the current event loop was set.
@serhiy-storchaka serhiy-storchaka changed the title gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created [3.11] gh-93453: Only emit deprecation warning in asyncio.get_event_loop when a new event loop is created Dec 2, 2022
@ambv

ambv commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

@ambv

ambv commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

Note that I'm fine with _get_event_loop() to disappear in 3.12 as it's an underscored name. I simply think it's going to be disruptive to change this in 3.11.1 and 3.10.9.

(I also resolved a conflict in any case to have CI green.)

@serhiy-storchaka

Copy link
Copy Markdown
Member Author

I do not think it is necessary, but I have no objections.

Comment thread Modules/_asynciomodule.c Outdated
@ambv

ambv commented Dec 5, 2022

Copy link
Copy Markdown
Contributor

OK, @serhiy-storchaka, then I'll adapt this PR to leave _asyncio._get_event_loop existing.

@gvanrossum gvanrossum left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do read my comments first!

Comment thread Doc/library/asyncio-eventloop.rst
Comment thread Doc/library/asyncio-policy.rst Outdated
Comment thread Lib/asyncio/events.py
@serhiy-storchaka

Copy link
Copy Markdown
Member Author

I afraid that I can create conflicts with Łukasz, so from now I'm stopping committing in this branch. In any case my internet connection is currently too bad and can disappear at any time.

@ambv

ambv commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

Thanks, @serhiy-storchaka, I reverted removal of asyncio.events._get_event_loop and _asyncio._get_event_loop. Look how obvious the remaining changes now look in the "Files changed" tab. I like this.

I will wait for everything to pass and then merge this to create a 3.10 backport.

@ambv ambv added the needs backport to 3.10 only security fixes label Dec 6, 2022
@ambv
ambv merged commit 3fae04b into python:3.11 Dec 6, 2022
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @serhiy-storchaka for the PR, and @ambv for merging it 🌮🎉.. I'm working now to backport this PR to: 3.10.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry @serhiy-storchaka and @ambv, I had trouble checking out the 3.10 backport branch.
Please retry by removing and re-adding the "needs backport to 3.10" label.
Alternatively, you can backport using cherry_picker on the command line.
cherry_picker 3fae04b10e2655a20a3aadb5e0d63e87206d0c67 3.10

@ambv

ambv commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

ambv pushed a commit to ambv/cpython that referenced this pull request Dec 6, 2022
…o.get_event_loop when a new event loop is created (pythonGH-99949)

It no longer emits a deprecation warning if the current event loop was set.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 3fae04b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@ZeroIntensity ZeroIntensity removed the needs backport to 3.10 only security fixes label Feb 17, 2025
@serhiy-storchaka
serhiy-storchaka deleted the asyncio-get_event_loop2-3.11 branch July 1, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants