mirror of https://github.com/django/django.git
Doc'd purpose of tuple() in SQLCompiler.get_from_clause().
It was added in01d440fa1e
to prevent "RuntimeError: OrderedDict mutated during iteration". That particular issue was fixed ind660cee5bc
but the issue could remain in Join.as_sql() subclasses. Co-authored-by: Simon Charette <charette.s@gmail.com>
This commit is contained in:
parent
082fe2b5a8
commit
252eaca87f
|
@ -1134,6 +1134,9 @@ class SQLCompiler:
|
||||||
"""
|
"""
|
||||||
result = []
|
result = []
|
||||||
params = []
|
params = []
|
||||||
|
# Copy alias_map to a tuple in case Join.as_sql() subclasses (objects
|
||||||
|
# in alias_map) alter compiler.query.alias_map. That would otherwise
|
||||||
|
# raise "RuntimeError: dictionary changed size during iteration".
|
||||||
for alias, from_clause in tuple(self.query.alias_map.items()):
|
for alias, from_clause in tuple(self.query.alias_map.items()):
|
||||||
if not self.query.alias_refcount[alias]:
|
if not self.query.alias_refcount[alias]:
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Reference in New Issue