Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos committed Nov 17, 2024
1 parent 66f97a9 commit 5adb3e4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions libs/checkpoint/langgraph/checkpoint/memory/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,9 @@ def __init__(
self.storage = factory(lambda: defaultdict(dict))
self.writes = factory(dict)
self.stack = ExitStack()
try:
if factory is not defaultdict:
self.stack.enter_context(self.storage) # type: ignore[arg-type]
self.stack.enter_context(self.writes) # type: ignore[arg-type]
except (TypeError, AttributeError):
pass

def __enter__(self) -> "MemorySaver":
return self.stack.__enter__()
Expand Down

0 comments on commit 5adb3e4

Please sign in to comment.