Closed neostimul closed 1 year ago
Hi @neostimul,
New version 1.21
has been released. This issue should be fixed now.
Unfortunately, I get the same error. I updated the plugin to 1.21 (and to 1.22 too) before testing
Could you please provide the code that you are using, cause I can't reproduce this issue on my local env
error in row if not (module == 'asyncio' or module.startswith('asyncio.')):
python3.11.1/asyncio/events.py:682
module variable is None
class BaseDefaultEventLoopPolicy(AbstractEventLoopPolicy):
"""Default policy implementation for accessing the event loop.
In this policy, each thread has its own event loop. However, we
only automatically create an event loop by default for the main
thread; other threads by default have no event loop.
Other policies may have different rules (e.g. a single global
event loop, or automatically creating an event loop per thread, or
using some other notion of context to which an event loop is
associated).
"""
_loop_factory = None
class _Local(threading.local):
_loop = None
_set_called = False
def __init__(self):
self._local = self._Local()
def get_event_loop(self):
"""Get the event loop for the current context.
Returns an instance of EventLoop or raises an exception.
"""
if (self._local._loop is None and
not self._local._set_called and
threading.current_thread() is threading.main_thread()):
stacklevel = 2
try:
f = sys._getframe(1)
except AttributeError:
pass
else:
while f:
module = f.f_globals.get('__name__')
if not (module == 'asyncio' or module.startswith('asyncio.')):
break
f = f.f_back
stacklevel += 1
import warnings
warnings.warn('There is no current event loop',
DeprecationWarning, stacklevel=stacklevel)
self.set_event_loop(self.new_event_loop())
if self._local._loop is None:
raise RuntimeError('There is no current event loop in thread %r.'
% threading.current_thread().name)
return self._local._loop
Hi @neostimul
New version 1.23 has been released.
I hope this issue should be fixed now because a plugin no longer uses nest-asycnio
library.
Hi @neostimul, Any updates?
Hi! Thanks a lot. Now everything works great!
Thanks for update!
Hello, thank You for your product. It's very helpful.
Got an error on running Python Console with python3.11.1 In asyncio module, get_event_loop method, a 682 row of asyncio/events.py