[issue46340] DeprecationWarning emitted when running asyncio tests

2022-01-22 Thread Kumar Aditya
Change by Kumar Aditya : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue46340] DeprecationWarning emitted when running asyncio tests

2022-01-11 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > get_event_loop() is deprecated when there is no running event loop. Yes, I see that now. So using asyncio.new_event_loop instead makes sense. -- ___ Python tracker

[issue46340] DeprecationWarning emitted when running asyncio tests

2022-01-11 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > I think there is no reason to replace all occurrences where get_event_loop() > works fine. +1 I provided the grep for information only, hence FTR (for the record). -- ___ Python tracker

[issue46340] DeprecationWarning emitted when running asyncio tests

2022-01-11 Thread Andrew Svetlov
Andrew Svetlov added the comment: get_event_loop() is deprecated when there is no running event loop. Otherwise, it is equal to get_running_loop() and IS NOT deprecated. I think there is no reason to replace all occurrences where get_event_loop() works fine. --

[issue46340] DeprecationWarning emitted when running asyncio tests

2022-01-11 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: FTR, a rough grep for other users of get_event_loop in Lib/test (some false positives): ``` $ grep -rE "\" Lib/test Lib/test/test_contextlib_async.py:loop = asyncio.get_event_loop_policy().get_event_loop()

[issue46340] DeprecationWarning emitted when running asyncio tests

2022-01-11 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Kumar, did you consider using get_running_loop() to retrieve the event loop in the current thread, instead of creating a new one? -- ___ Python tracker

[issue46340] DeprecationWarning emitted when running asyncio tests

2022-01-11 Thread Erlend E. Aasland
New submission from Erlend E. Aasland : Providing some more background, based on the changes proposed by Kumar in GH-30486: asyncio.get_event_loop() was marked as deprecated in Python 3.10. Quoting from the asyncio documentation , https://docs.python.org/3/library/asyncio-eventloop.html (as

[issue46340] DeprecationWarning emitted when running asyncio tests

2022-01-10 Thread Kumar Aditya
Change by Kumar Aditya : -- components: asyncio nosy: asvetlov, kumaraditya303, yselivanov priority: normal pull_requests: 28727 severity: normal status: open title: DeprecationWarning emitted when running asyncio tests versions: Python 3.11 ___