Skip to content
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

fix: Remove deprecated get_event_loop() in favour of alternative methods #2612

Closed
wants to merge 5 commits into from

Conversation

Revnoplex
Copy link
Contributor

@Revnoplex Revnoplex commented Oct 19, 2024

Summary

get_event_loop() is deprecated. All instances should be replaced in favour of get_running_loop() and whatever other alternative.

Information

  • This PR fixes an issue.
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested. (currently in progress. 4/7 files tested...)
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

@Revnoplex
Copy link
Contributor Author

ah, for some reason the changes broke ext.tasks. I'm not sure why

@JustaSqu1d JustaSqu1d added priority: medium Medium Priority status: in progress Work in Progess python Pull requests that update Python code labels Oct 21, 2024
@Revnoplex
Copy link
Contributor Author

Revnoplex commented Oct 21, 2024

For some reason the behaviour of replacing get_event_loop with new_event_loop in Client causes create_tasks in tasks.py to never run

@Revnoplex
Copy link
Contributor Author

new_event_loop is no good. Using get_event_loop_policy().get_event_loop() instead per https://docs.python.org/3/library/asyncio-eventloop.html#asyncio.get_event_loop and python/cpython#93453

@Revnoplex Revnoplex changed the title fix: Remove deprecated get_event_loop() in favor of new_event_loop() fix: Remove deprecated get_event_loop() in favour of get_event_loop_policy().get_event_loop() Oct 21, 2024
@Revnoplex Revnoplex changed the title fix: Remove deprecated get_event_loop() in favour of get_event_loop_policy().get_event_loop() fix: Remove deprecated get_event_loop() in favour of alternative methods Oct 21, 2024
@Revnoplex
Copy link
Contributor Author

Revnoplex commented Oct 21, 2024

This is getting too complicated. I'm closing this.

@Revnoplex Revnoplex closed this Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium Medium Priority python Pull requests that update Python code status: in progress Work in Progess
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants