diff --git a/plugins/python/parser/pyparser/parser.py b/plugins/python/parser/pyparser/parser.py index 3201c3eb4..73f46d9ff 100644 --- a/plugins/python/parser/pyparser/parser.py +++ b/plugins/python/parser/pyparser/parser.py @@ -1,4 +1,5 @@ import os +import sys import jedi import multiprocessing import traceback @@ -71,6 +72,10 @@ def parseProject(settings, n_proc): log(f"{bcolors.FAIL}Failed to use virtual environment: {config.venv_path}") if config.stack_trace: traceback.print_exc() + else: + log(f"{bcolors.FAIL}Apply the --stack-trace parser option to view a more detailed stack trace of the error") + + sys.exit(1) log(f"{bcolors.OKGREEN}Using {n_proc} process to parse project") diff --git a/plugins/python/parser/requirements.txt b/plugins/python/parser/requirements.txt index 18d880e9d..a80770b57 100644 --- a/plugins/python/parser/requirements.txt +++ b/plugins/python/parser/requirements.txt @@ -1,2 +1,2 @@ -jedi==0.18.0 -parso==0.8.4 +jedi==0.19.2 +parso==0.8.6 diff --git a/plugins/python/test/src/pythonparsertest.cpp b/plugins/python/test/src/pythonparsertest.cpp index c656e4b29..fcf36b223 100644 --- a/plugins/python/test/src/pythonparsertest.cpp +++ b/plugins/python/test/src/pythonparsertest.cpp @@ -408,47 +408,6 @@ TEST_F(PythonParserTest, ImportModule) EXPECT_EQ(pyname.is_import, true); } -TEST_F(PythonParserTest, BuiltinVariable) -{ - model::PYName pyname; - - pyname = queryFile("imports.py", - (odb::query::line_start == 2 && - odb::query::value == "import os")); - - EXPECT_EQ(pyname.is_builtin, true); - - pyname = queryFile("imports.py", - (odb::query::line_start == 6 && - odb::query::value == "print")); - - EXPECT_EQ(pyname.is_builtin, true); - - pyname = queryFile("imports.py", - (odb::query::line_start == 12 && - odb::query::value == "getpid")); - - EXPECT_EQ(pyname.is_builtin, true); - - pyname = queryFile("functions.py", - (odb::query::line_start == 85 && - odb::query::value == "str")); - - EXPECT_EQ(pyname.is_builtin, true); - - pyname = queryFile("functions.py", - (odb::query::line_start == 85 && - odb::query::value == "List")); - - EXPECT_EQ(pyname.is_builtin, true); - - pyname = queryFile("functions.py", - (odb::query::line_start == 98 && - odb::query::value == "range")); - - EXPECT_EQ(pyname.is_builtin, true); -} - TEST_F(PythonParserTest, ReferenceID) { model::PYName pyname;