Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Can't patch loop of type <class 'NoneType'> #62

Closed
adriangonz opened this issue Dec 1, 2021 · 2 comments
Closed

Can't patch loop of type <class 'NoneType'> #62

adriangonz opened this issue Dec 1, 2021 · 2 comments

Comments

@adriangonz
Copy link

After updating to nest_asyncio==1.5.2, it seems that our test suite has started to fail with the following error (the nest_asyncio==1.5.1 release still seems to work fine though):

runtimes/alibi-explain/tests/conftest.py:29: in <module>
    nest_asyncio.apply()
../../.virtualenvs/mlserver-37/lib/python3.7/site-packages/nest_asyncio.py:14: in apply
    raise ValueError('Can\'t patch loop of type %s' % type(loop))
E   ValueError: Can't patch loop of type <class 'NoneType'>

Could this be due to calling nest_asyncio.apply() before an async loop has been created?

@foxik
Copy link

foxik commented Dec 1, 2021

We have also been bitten by the same problem -- after installation of Jupyter, jupyter-notebook crashed because loop is None during its startup.

Downgrade to nest_asyncio 1.5.1 solves the problem.

yetinam added a commit to seisbench/seisbench that referenced this issue Dec 1, 2021
@erdewit erdewit closed this as completed in 4a5b993 Dec 1, 2021
@erdewit
Copy link
Owner

erdewit commented Dec 1, 2021

This is fixed now in v1.5.3

I was trying to replace asyncio.get_event_loop() as it will apparently start to throw an exception in Python 3.11 when the event loop is not running.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants