bugfix: crash when using fractions

This commit is contained in:
Philippe Daouadi 2014-04-25 21:42:08 +02:00
commit 1f9125af88

View file

@ -377,7 +377,7 @@ def color_scale( name, text ):
import babel.numbers as bn import babel.numbers as bn
try: try:
f = float(bn.parse_decimal(nb)) f = float(bn.parse_decimal(nb))
except NumberFormatError: except bn.NumberFormatError:
f = eval(nb) # Note: in python2, `eval(2/3)` would produce `0`, in python3 `0.666` f = eval(nb) # Note: in python2, `eval(2/3)` would produce `0`, in python3 `0.666`
except ImportError: except ImportError:
try: try: