You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The use of asyncio.get_event_loop causes a DeprecationWarning for Python 3.10, and will become an error in some future version of Python.
Here's the output of the test run on my machine on Python 3.10:
(traits-futures) mdickinson@mirzakhani traits-futures % python -m unittest
/Users/mdickinson/Enthought/Projects/traits-futures/traits_futures/asyncio/event_loop.py:28: DeprecationWarning: There is no current event loop
self._event_loop = asyncio.get_event_loop()
................ssssssssssssssss............................................................/Users/mdickinson/.venvs/traits-futures/lib/python3.10/site-packages/pyface/base_toolkit.py:285: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
plugin for plugin in importlib_metadata.entry_points()[entry_point]
../Users/mdickinson/.venvs/traits-futures/lib/python3.10/site-packages/pyface/base_toolkit.py:216: DeprecationWarning: SelectableGroups dict interface is deprecated. Use select.
entry_point_group = importlib_metadata.entry_points()[entry_point]
....ss................................................................................................/Users/mdickinson/Enthought/Projects/traits-futures/traits_futures/asyncio/event_loop.py:28: DeprecationWarning: There is no current event loop
self._event_loop = asyncio.get_event_loop()
../Users/mdickinson/Enthought/Projects/traits-futures/traits_futures/asyncio/event_loop.py:28: DeprecationWarning: There is no current event loop
self._event_loop = asyncio.get_event_loop()
./Users/mdickinson/Enthought/Projects/traits-futures/traits_futures/asyncio/event_loop.py:28: DeprecationWarning: There is no current event loop
self._event_loop = asyncio.get_event_loop()
............/Users/mdickinson/Enthought/Projects/traits-futures/traits_futures/asyncio/event_loop.py:28: DeprecationWarning: There is no current event loop
self._event_loop = asyncio.get_event_loop()
..................../Users/mdickinson/Enthought/Projects/traits-futures/traits_futures/asyncio/event_loop.py:28: DeprecationWarning: There is no current event loop
self._event_loop = asyncio.get_event_loop()
../Users/mdickinson/Enthought/Projects/traits-futures/traits_futures/asyncio/event_loop.py:28: DeprecationWarning: There is no current event loop
self._event_loop = asyncio.get_event_loop()
./Users/mdickinson/Enthought/Projects/traits-futures/traits_futures/asyncio/event_loop.py:28: DeprecationWarning: There is no current event loop
self._event_loop = asyncio.get_event_loop()
..................../Users/mdickinson/Enthought/Projects/traits-futures/traits_futures/asyncio/event_loop.py:28: DeprecationWarning: There is no current event loop
self._event_loop = asyncio.get_event_loop()
../Users/mdickinson/Enthought/Projects/traits-futures/traits_futures/asyncio/event_loop.py:28: DeprecationWarning: There is no current event loop
self._event_loop = asyncio.get_event_loop()
./Users/mdickinson/Enthought/Projects/traits-futures/traits_futures/asyncio/event_loop.py:28: DeprecationWarning: There is no current event loop
self._event_loop = asyncio.get_event_loop()
...........ssssssssssssssss
----------------------------------------------------------------------
Ran 284 tests in 19.763s
OK (skipped=34)
The easiest quick fix is to replace uses of asyncio.get_event_loop with asyncio.new_event_loop. The catch is that that leaves us responsible for clearing up (i.e., explicitly closing) those event loops, to avoid getting ResourceWarning warnings.
The use of
asyncio.get_event_loop
causes aDeprecationWarning
for Python 3.10, and will become an error in some future version of Python.Here's the output of the test run on my machine on Python 3.10:
The easiest quick fix is to replace uses of
asyncio.get_event_loop
withasyncio.new_event_loop
. The catch is that that leaves us responsible for clearing up (i.e., explicitly closing) those event loops, to avoid gettingResourceWarning
warnings.See https://bugs.python.org/issue39529 for the rationale for the deprecation, and related discussion.
The text was updated successfully, but these errors were encountered: