summaryrefslogtreecommitdiffstats
path: root/Lib/fractions.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2009-01-03 22:03:11 (GMT)
committerGeorg Brandl <georg@python.org>2009-01-03 22:03:11 (GMT)
commitfe427895b58769840f1f61a82ea0cdfe55150347 (patch)
treeba6fc9493239a122199292caada1e9345d26e8f6 /Lib/fractions.py
parentc63785db867804de8b676ddddcc90c3fcbf2c111 (diff)
downloadcpython-fe427895b58769840f1f61a82ea0cdfe55150347.zip
cpython-fe427895b58769840f1f61a82ea0cdfe55150347.tar.gz
cpython-fe427895b58769840f1f61a82ea0cdfe55150347.tar.bz2
Manually merge r68095,68186,68187,68188,68190 from 2.6 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 4adb184..446ad8e 100755
--- a/Lib/fractions.py
+++ b/Lib/fractions.py
@@ -111,7 +111,7 @@ class Fraction(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__))