summaryrefslogtreecommitdiffstats
path: root/Lib/fpformat.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1999-09-10 14:34:48 (GMT)
committerGuido van Rossum <guido@python.org>1999-09-10 14:34:48 (GMT)
commit75ae7e7dfa49a3e1d094d3a4f1dc2782323f347d (patch)
tree295af24603e972b127de52dbe90daf9226457dca /Lib/fpformat.py
parent148ffbc886a35751ca65447de5c22387ce7ca6f0 (diff)
downloadcpython-75ae7e7dfa49a3e1d094d3a4f1dc2782323f347d.zip
cpython-75ae7e7dfa49a3e1d094d3a4f1dc2782323f347d.tar.gz
cpython-75ae7e7dfa49a3e1d094d3a4f1dc2782323f347d.tar.bz2
Fix for PR#74 -- use int() instead of eval() to extract the exponent.
Diffstat (limited to 'Lib/fpformat.py')
-rw-r--r--Lib/fpformat.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/fpformat.py b/Lib/fpformat.py
index a9c405e..74f5698 100644
--- a/Lib/fpformat.py
+++ b/Lib/fpformat.py
@@ -38,7 +38,7 @@ def extract(s):
sign, intpart, fraction, exppart = res.group(1,2,3,4)
if sign == '+': sign = ''
if fraction: fraction = fraction[1:]
- if exppart: expo = eval(exppart[1:])
+ if exppart: expo = int(exppart[1:])
else: expo = 0
return sign, intpart, fraction, expo