mirror of
https://github.com/hwchase17/langchain
synced 2024-11-08 07:10:35 +00:00
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.
This commit is contained in:
parent
e178008b75
commit
59157b6891
@ -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…
Reference in New Issue
Block a user