Skip to content

Commit 021e975

Browse files
Fix Python plugin venv loading
Updated the Python parser's dependencies to the latest version since newer Python versions require a more recent version of the Jedi parsing library to load the Python virtual environment (venv). Also made a minor mix: failing to load a virtual environment is a major misconfiguration issue, so the parser now exits with and error.
1 parent 3755e3f commit 021e975

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

plugins/python/parser/pyparser/parser.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import os
2+
import sys
23
import jedi
34
import multiprocessing
45
import traceback
@@ -71,6 +72,10 @@ def parseProject(settings, n_proc):
7172
log(f"{bcolors.FAIL}Failed to use virtual environment: {config.venv_path}")
7273
if config.stack_trace:
7374
traceback.print_exc()
75+
else:
76+
log(f"{bcolors.FAIL}Apply the --stack-trace parser option to view a more detailed stack trace of the error")
77+
78+
sys.exit(1)
7479

7580
log(f"{bcolors.OKGREEN}Using {n_proc} process to parse project")
7681

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
jedi==0.18.0
2-
parso==0.8.4
1+
jedi==0.19.2
2+
parso==0.8.6

0 commit comments

Comments
 (0)