mirror of
https://github.com/django/django.git
synced 2025-04-20 07:14:35 +00:00
Doc'd purpose of tuple() in SQLCompiler.get_from_clause().
It was added in 01d440fa1e6b5c62acfa8b3fde43dfa1505f93c6 to prevent "RuntimeError: OrderedDict mutated during iteration". That particular issue was fixed in d660cee5bc68b597503c2a16f3d9928d52f93fb4 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 = []
|
||||
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()):
|
||||
if not self.query.alias_refcount[alias]:
|
||||
continue
|
||||
|
Loading…
x
Reference in New Issue
Block a user