From 6a42128ddf4a0a053ae95d4db65c67441db3e838 Mon Sep 17 00:00:00 2001 From: Keith Bussell Date: Mon, 6 Aug 2018 21:39:10 -0700 Subject: [PATCH] Add Python 2.7-specific comment --- rest_framework/fields.py | 1 + 1 file changed, 1 insertion(+) diff --git a/rest_framework/fields.py b/rest_framework/fields.py index d5071a1aa..92caa6a38 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1135,6 +1135,7 @@ class DecimalField(Field): return value context = decimal.getcontext().copy() + # For Python 2.7 compatibility when using cdecimal rounding = context.rounding if self.rounding is None else self.rounding if self.max_digits is not None: context.prec = self.max_digits