pycord icon indicating copy to clipboard operation
pycord copied to clipboard

fix: Remove deprecated get_event_loop() in favor of new_event_loop()

Open Revnoplex opened this issue 1 year ago • 1 comments

Summary

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

Information

  • [x] 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

  • [x] 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...)
    • [x] I have updated the documentation to reflect the changes.
  • [ ] If type: ignore comments were used, a comment is also left explaining why.
  • [x] I have updated the changelog to include these changes.

Revnoplex avatar Oct 19 '24 12:10 Revnoplex

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

Revnoplex avatar Oct 20 '24 12:10 Revnoplex

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 avatar Oct 21 '24 09:10 Revnoplex

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 https://github.com/python/cpython/issues/93453

Revnoplex avatar Oct 21 '24 10:10 Revnoplex

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

Revnoplex avatar Oct 21 '24 10:10 Revnoplex