From 04cc1964bd84b78d328ecdd2735b884ea075a877 Mon Sep 17 00:00:00 2001 From: Aider Ibragimov Date: Tue, 3 Mar 2015 16:45:20 +0300 Subject: [PATCH] remove dict compehension --- rest_framework/fields.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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: