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
Describe the bug
When using a GUI library in the pyGuiLibraries setting, and the version of python/python3 in the terminal does not match what you ahve in VSCode, you can get a syntaxerror when no syntax error should appear.
To Reproduce
Steps to reproduce the behavior:
set python version to 3.11
But have a earlier version of python be first in your PATH, so python/python3 is linked to a earlier version of python
Run the below code twice
importtkintertry:
raiseExceptionGroup("eg",
[ValueError(1), TypeError(2), OSError(3), OSError(4)])
except* TypeErrorase:
print(f'caught {type(e)} with nested {e.exceptions}')
except* OSErrorase:
print(f'caught {type(e)} with nested {e.exceptions}')
Expected behavior
A clear and concise description of what you expected to happen.
No syntax error. This is valid 3.11 syntax.
Additional context
Error:
Command failed: python -m py_compile C:\Users\almenon\AppData\Local\Temp\pythonShellSyntaxCheck5067851224.py
Traceback (most recent call last):
File "C:\Users\almenon\AppData\Local\Programs\Python\Python38-32\lib\py_compile.py", line 144, in compile
code = loader.source_to_code(source_bytes, dfile or file,
File "<frozen importlib._bootstrap_external>", line 846, in source_to_code
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\almenon\AppData\Local\Temp\pythonShellSyntaxCheck5067851224.py", line 5
except* TypeError as e:
^
SyntaxError: invalid syntax
The text was updated successfully, but these errors were encountered:
This is because this.PythonEvaluator.checkSyntax calls the static method PythonShell.checkSyntax, which uses the static variables defaultOptions.pythonPath or this.defaultPythonPath. These static variables can have a different python than what is set in the instance of the class.
I'll probably end up refactoring the code to avoid this issue in #439
Describe the bug
When using a GUI library in the
pyGuiLibraries
setting, and the version ofpython
/python3
in the terminal does not match what you ahve in VSCode, you can get a syntaxerror when no syntax error should appear.To Reproduce
Steps to reproduce the behavior:
python
/python3
is linked to a earlier version of pythonExpected behavior
A clear and concise description of what you expected to happen.
No syntax error. This is valid 3.11 syntax.
Additional context
Error:
The text was updated successfully, but these errors were encountered: