Skip to content

Commit b44971f

Browse files
committed
Revert "fix: python.lang.security.audit.eval-detected.eval-detected-python-helpers-memory.py (#444)"
This reverts commit de39128.
1 parent de39128 commit b44971f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

python/helpers/memory.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import ast
21
from datetime import datetime
32
from typing import Any, List, Sequence
43
from langchain.storage import InMemoryByteStore, LocalFileStore
@@ -392,7 +391,7 @@ def _save_db_file(db: MyFaiss, memory_subdir: str):
392391
def _get_comparator(condition: str):
393392
def comparator(data: dict[str, Any]):
394393
try:
395-
return ast.literal_eval(condition, {}, data)
394+
return eval(condition, {}, data)
396395
except Exception as e:
397396
# PrintStyle.error(f"Error evaluating condition: {e}")
398397
return False

0 commit comments

Comments
 (0)