Used isort to sort imports. Also added to the git pre-commit hook.
[python_utils.git] / type / centcount.py
index 4181721bbc0d4ab7efe38608b821faa26ecf5bae..4e5b8a6aa6b4b8ef61671b93b0284825cdf75cbc 100644 (file)
@@ -11,7 +11,8 @@ T = TypeVar('T', bound='CentCount')
 
 class CentCount(object):
     """A class for representing monetary amounts potentially with
-    different currencies.
+    different currencies meant to avoid floating point rounding
+    issues by treating amount as a simple integral count of cents.
     """
 
     def __init__ (
@@ -210,7 +211,7 @@ class CentCount(object):
                     centcount = int(float(chunk) * 100.0)
                 elif CentCount.CURRENCY_RE.match(chunk) is not None:
                     currency = chunk
-        except:
+        except Exception:
             pass
         if centcount is not None and currency is not None:
             return (centcount, currency)