pycharm-evaluate-async-code icon indicating copy to clipboard operation
pycharm-evaluate-async-code copied to clipboard

Great plugin , but doesn't work anymore in pycharm 2021.3.1

Open pfrantz opened this issue 3 years ago • 5 comments

Basically if you try and await in a console you get SyntaxError: 'await' outside function -

I use a virtual environment - used to work beautifully before upgrading pycharm . I am also on the latest version of the plugin 1.19.

if it helps. the stacktrace looks like this:-

import asyncio
await asyncio.sleep(1)

Traceback (most recent call last):
  File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/code.py", line 63, in runsource
    code = self.compile(source, filename, symbol)
  File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/codeop.py", line 178, in __call__
    return _maybe_compile(self.compiler, source, filename, symbol)
  File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/codeop.py", line 106, in _maybe_compile
    raise err1
  File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/codeop.py", line 93, in _maybe_compile
    code1 = compiler(source + "\n", filename, symbol)
  File "/usr/local/Cellar/[email protected]/3.9.9/Frameworks/Python.framework/Versions/3.9/lib/python3.9/codeop.py", line 143, in __call__
    codeob = compile(source, filename, symbol, self.flags, True)
  File "<input>", line 1
SyntaxError: 'await' outside function

pfrantz avatar Jan 19 '22 00:01 pfrantz

Thanks, I will take close look.

uriyyo avatar Jan 19 '22 11:01 uriyyo

Any news on that?

chrismaille avatar Mar 17 '22 15:03 chrismaille

Hi @chrismaille,

Will try to fix this one.

uriyyo avatar Mar 18 '22 08:03 uriyyo

Hi @uriyyo, did you manage to take a look and see if that can be fixed?

krmozejko avatar Jul 21 '22 08:07 krmozejko

Hi @krmozejko,

Unfortunately, there are changes inside PyCharm API. I am trying to figure out how can I fix it.

uriyyo avatar Jul 23 '22 08:07 uriyyo

Hi @pfrantz, @chrismaille, @krmozejko

This issue should be fixed in version 1.20. Please, reopen this issue in the case when issue is still present.

uriyyo avatar Aug 10 '22 07:08 uriyyo