summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorStanislav Laznicka <slaznick@redhat.com>2017-08-22 13:26:01 +0200
committerStanislav Laznicka <slaznick@redhat.com>2017-09-08 15:42:07 +0200
commitf7fc3a3fc1bf25158206cd26d90aa392037fe17a (patch)
treef12086b33699ce1e4e4cc0fe8c5361baa9bf13df /ipalib
parent3c616d733b6be9958c301027f5bf308c4c6ec366 (diff)
downloadfreeipa-f7fc3a3fc1bf25158206cd26d90aa392037fe17a.tar.gz
freeipa-f7fc3a3fc1bf25158206cd26d90aa392037fe17a.tar.xz
freeipa-f7fc3a3fc1bf25158206cd26d90aa392037fe17a.zip
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>
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/parameters.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipalib/parameters.py b/ipalib/parameters.py
index 462e6e35e..81586e2c9 100644
--- a/ipalib/parameters.py
+++ b/ipalib/parameters.py
@@ -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: