mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 19:40:13 +03:00
Add Python 2.7-specific comment
This commit is contained in:
parent
5bb7db2d6f
commit
6a42128ddf
|
@ -1135,6 +1135,7 @@ class DecimalField(Field):
|
||||||
return value
|
return value
|
||||||
|
|
||||||
context = decimal.getcontext().copy()
|
context = decimal.getcontext().copy()
|
||||||
|
# For Python 2.7 compatibility when using cdecimal
|
||||||
rounding = context.rounding if self.rounding is None else self.rounding
|
rounding = context.rounding if self.rounding is None else self.rounding
|
||||||
if self.max_digits is not None:
|
if self.max_digits is not None:
|
||||||
context.prec = self.max_digits
|
context.prec = self.max_digits
|
||||||
|
|
Loading…
Reference in New Issue
Block a user