Bug: Fix Python version validation in PythonAstREPLTool (#1373)

The current logic checks if the Python major version is < 8, which is
wrong. This checks if the major and minor version is < 3.9.
searx-doc
Ryan Dao 1 year ago committed by GitHub
parent e178008b75
commit 59157b6891
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -51,7 +51,7 @@ class PythonAstREPLTool(BaseTool):
@root_validator(pre=True)
def validate_python_version(cls, values: Dict) -> Dict:
"""Validate valid python version."""
if sys.version_info[0] <= 8:
if sys.version_info < (3, 9):
raise ValueError(
"This tool relies on Python 3.9 or higher "
"(as it uses new functionality in the `ast` module, "

Loading…
Cancel
Save