Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 75ae7e7

Browse files
committed
Fix for PR#74 -- use int() instead of eval() to extract the exponent.
1 parent 148ffbc commit 75ae7e7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Lib/fpformat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def extract(s):
3838
sign, intpart, fraction, exppart = res.group(1,2,3,4)
3939
if sign == '+': sign = ''
4040
if fraction: fraction = fraction[1:]
41-
if exppart: expo = eval(exppart[1:])
41+
if exppart: expo = int(exppart[1:])
4242
else: expo = 0
4343
return sign, intpart, fraction, expo
4444

0 commit comments

Comments
 (0)