Use the same exception hierarchy as decimal.py. FloatOperation now also

inherits from TypeError. Cleanup in module initialization to make repeated
import failures robust.
This commit is contained in:
Stefan Krah 2012-03-23 14:46:48 +01:00
parent 4b0215fd99
commit b6405efd1b
4 changed files with 107 additions and 22 deletions

View file

@ -391,7 +391,7 @@ class Underflow(Inexact, Rounded, Subnormal):
In all cases, Inexact, Rounded, and Subnormal will also be raised.
"""
class FloatOperation(DecimalException):
class FloatOperation(DecimalException, TypeError):
"""Enable stricter semantics for mixing floats and Decimals.
If the signal is not trapped (default), mixing floats and Decimals is