uriyyo / pycharm-evaluate-async-code

Finally, you can use await in evaluate expression 💪
https://plugins.jetbrains.com/plugin/14476-evaluate-async-code
44 stars 2 forks source link

Crashing in PyCharm debugger on Django tests #63

Closed mikulas-mrva closed 1 year ago

mikulas-mrva commented 1 year ago

This started happening for me when running Django tests in PyCharm debugger, it crashes on various instances of sync_to_async.

  File "/Users/dev/.envs/pwn_backend_py_3_10/lib/python3.10/site-packages/asgiref/sync.py", line 220, in __call__
    loop_future.result()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 451, in result
    return self.__get_result()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 403, in __get_result
    raise self._exception
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/Users/dev/.envs/pwn_backend_py_3_10/lib/python3.10/site-packages/asgiref/sync.py", line 276, in _run_event_loop
    asyncio.set_event_loop(self.main_event_loop)
  File "/Users/dev/Library/Application Support/JetBrains/PyCharm2023.1/plugins/evaluate-async-code/_pydevd_async_debug.py", line 325, in set_loop_wrapper
    _patch_loop_if_not_patched(loop)
  File "/Users/dev/Library/Application Support/JetBrains/PyCharm2023.1/plugins/evaluate-async-code/_pydevd_async_debug.py", line 307, in _patch_loop_if_not_patched
    _patch_loop(loop)
  File "/Users/dev/Library/Application Support/JetBrains/PyCharm2023.1/plugins/evaluate-async-code/_pydevd_async_debug.py", line 175, in _patch_loop
    raise ValueError('Can\'t patch loop of type %s' % type(loop))
ValueError: Can't patch loop of type <class 'NoneType'>
uriyyo commented 1 year ago

Thanks, I will take a look

uriyyo commented 1 year ago

Hi @mikulas-mrva

New version 1.23 has been released. This issue should be fixed now.

Could you please confirm that this issue is no longer present?

uriyyo commented 1 year ago

Hi @mikulas-mrva,

Any updates?

mikulas-mrva commented 1 year ago

@uriyyo Works as expected now, thanks a lot!