Skip to content

Commit

Permalink
Add Python 2.7-specific comment
Browse files Browse the repository at this point in the history
  • Loading branch information
kbussell committed Aug 7, 2018
1 parent 5bb7db2 commit 6a42128
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions rest_framework/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@ def quantize(self, value):
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
Expand Down

0 comments on commit 6a42128

Please sign in to comment.