summaryrefslogtreecommitdiffstats
path: root/Lib/fractions.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-01-03 22:07:57 (GMT)
committerGeorg Brandl <georg@python.org>2009-01-03 22:07:57 (GMT)
commit3a9b062f5bb0f7d9c2a408c31509cdee4f6aa4c8 (patch)
tree1bc74abad9db6c9a36875d97c1229998ea26fa4f /Lib/fractions.py
parent3f5f8228c02618480a2fd6bc8583621a94bacf2f (diff)
downloadcpython-3a9b062f5bb0f7d9c2a408c31509cdee4f6aa4c8.zip
cpython-3a9b062f5bb0f7d9c2a408c31509cdee4f6aa4c8.tar.gz
cpython-3a9b062f5bb0f7d9c2a408c31509cdee4f6aa4c8.tar.bz2
Manually merge r68096,68189 from 3.0 branch.
Diffstat (limited to 'Lib/fractions.py')
-rwxr-xr-xLib/fractions.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/fractions.py b/Lib/fractions.py
index bc06524..ed1e9a0 100755
--- a/Lib/fractions.py
+++ b/Lib/fractions.py
@@ -109,7 +109,7 @@ class Fraction(numbers.Rational):
"""
if isinstance(f, numbers.Integral):
- f = float(f)
+ return cls(f)
elif not isinstance(f, float):
raise TypeError("%s.from_float() only takes floats, not %r (%s)" %
(cls.__name__, f, type(f).__name__))