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__ (
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)