Commit fb0019d7 authored by adam j hartz's avatar adam j hartz

fix support for underscores in numbers in earlier pythons

parent 2b72c684
......@@ -173,7 +173,10 @@ Fraction.__repr__ = Fraction.__str__ = _frac_repr
def tako_num(x):
nmode = builtins.__tako_env__['TAKO_SETTINGS'].number_mode
if nmode in {'python', 'hybrid'}:
return ast.literal_eval(x)
try:
return ast.literal_eval(x)
except:
return ast.literal_eval(x.replace('_', ''))
elif nmode == 'exact':
try:
return int(x)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment