summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2021-07-15 10:36:53 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2021-07-15 10:37:52 -0400
commitf3c4735c0bef6325e977876e12fc476da363ec3c (patch)
tree7d3866f6cb69ae1f4857af0e60898ec5eff38920 /lib
parentdaaf36840bb3ebbaea3722413998604ed21d36a8 (diff)
downloadsqlalchemy-f3c4735c0bef6325e977876e12fc476da363ec3c.tar.gz
apply list() around weakkeydictionary iteration
Fixed an issue where clearing of mappers during things like test suite teardowns could cause a "dictionary changed size" warning during garbage collection, due to iteration of a weak-referencing dictionary. A ``list()`` has been applied to prevent concurrent GC from affecting this operation. Fixes: #6771 Change-Id: I3e1d67e978b2726a282d8b327457f2d4b239a0c6
Diffstat (limited to 'lib')
-rw-r--r--lib/sqlalchemy/orm/decl_api.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/sqlalchemy/orm/decl_api.py b/lib/sqlalchemy/orm/decl_api.py
index 54e927ee4..23b89a543 100644
--- a/lib/sqlalchemy/orm/decl_api.py
+++ b/lib/sqlalchemy/orm/decl_api.py
@@ -624,14 +624,14 @@ class registry(object):
return itertools.chain(
(
manager.mapper
- for manager in self._managers
+ for manager in list(self._managers)
if manager.is_mapped
and not manager.mapper.configured
and manager.mapper._ready_for_configure
),
(
npm
- for npm in self._non_primary_mappers
+ for npm in list(self._non_primary_mappers)
if not npm.configured and npm._ready_for_configure
),
)