diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 63fb0ae8e..b6f049ea0 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -672,9 +672,9 @@ class FilePathField(CharField): ) self.choices = OrderedDict(field.choices) - self.choice_strings_to_values = { - six.text_type(key): key for key in self.choices.keys() - } + self.choice_strings_to_values = dict([ + (six.text_type(key), key) for key in self.choices.keys() + ]) def to_internal_value(self, data): if data == '' and self.allow_blank: