From 25d8229bf9843b857b1918026dc45da92771fa7c Mon Sep 17 00:00:00 2001 From: Stanislav Laznicka Date: Sep 12 2017 10:20:42 +0000 Subject: 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 Reviewed-By: Florence Blanc-Renaud --- diff --git a/ipalib/parameters.py b/ipalib/parameters.py index 462e6e3..81586e2 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: