mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-25 14:40:16 -05: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:
1 parent
3c616d733b
commit
f7fc3a3fc1
1 file changed
+1
-1
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user