From 59816435dae75db9712f80c34734813a0246205a Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Wed, 1 Apr 2015 16:55:58 -0400 Subject: - Added a list() call around a weak dictionary used within the commit phase of the session, which without it could cause a "dictionary changed size during iter" error if garbage collection interacted within the process. Change was introduced by --- lib/sqlalchemy/orm/session.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/orm') diff --git a/lib/sqlalchemy/orm/session.py b/lib/sqlalchemy/orm/session.py index bc9444040..f3ad2349c 100644 --- a/lib/sqlalchemy/orm/session.py +++ b/lib/sqlalchemy/orm/session.py @@ -300,7 +300,7 @@ class SessionTransaction(object): if not self.nested and self.session.expire_on_commit: for s in self.session.identity_map.all_states(): s._expire(s.dict, self.session.identity_map._modified) - for s in self._deleted: + for s in list(self._deleted): s._detach() self._deleted.clear() elif self.nested: -- cgit v1.2.1