mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
parameters: convert Decimal.precision to int
Explicitly convert Decimal.precision to int for unary `-` to make sure int is passed to it. Fixes pylint warning. https://pagure.io/freeipa/issue/6874 Reviewed-By: Alexander Bokovoy <abokovoy@redhat.com>
This commit is contained in:
parent
3c616d733b
commit
f7fc3a3fc1
@ -1227,7 +1227,7 @@ class Decimal(Number):
|
||||
def _enforce_precision(self, value):
|
||||
assert type(value) is decimal.Decimal
|
||||
if self.precision is not None:
|
||||
quantize_exp = decimal.Decimal(10) ** -self.precision
|
||||
quantize_exp = decimal.Decimal(10) ** -int(self.precision)
|
||||
try:
|
||||
value = value.quantize(quantize_exp)
|
||||
except decimal.DecimalException as e:
|
||||
|
Loading…
Reference in New Issue
Block a user