mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-07 13:40:46 +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)
|
@root_validator(pre=True)
|
||||||
def validate_python_version(cls, values: Dict) -> Dict:
|
def validate_python_version(cls, values: Dict) -> Dict:
|
||||||
"""Validate valid python version."""
|
"""Validate valid python version."""
|
||||||
if sys.version_info[0] <= 8:
|
if sys.version_info < (3, 9):
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
"This tool relies on Python 3.9 or higher "
|
"This tool relies on Python 3.9 or higher "
|
||||||
"(as it uses new functionality in the `ast` module, "
|
"(as it uses new functionality in the `ast` module, "
|
||||||
|
Loading…
Reference in New Issue
Block a user