From 12cda89ffe6a03031a321d61ff8b91f9978e4b2e Mon Sep 17 00:00:00 2001 From: Aymeric Augustin Date: Tue, 7 Aug 2012 15:49:33 +0200 Subject: [PATCH] [py3] Fixed a loop that changed dictionary size. --- django/db/models/fields/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 2c38e8d72e..3737a504bb 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -489,7 +489,7 @@ class Field(object): # Many of the subclass-specific formfield arguments (min_value, # max_value) don't apply for choice fields, so be sure to only pass # the values that TypedChoiceField will understand. - for k in kwargs.keys(): + for k in list(six.iterkeys(kwargs)): if k not in ('coerce', 'empty_value', 'choices', 'required', 'widget', 'label', 'initial', 'help_text', 'error_messages', 'show_hidden_initial'):