mirror of
https://github.com/python/cpython.git
synced 2025-07-29 14:15:07 +00:00
Manually merge r68095,68186,68187,68188,68190 from 2.6 branch.
This commit is contained in:
parent
c63785db86
commit
fe427895b5
5 changed files with 25 additions and 8 deletions
|
@ -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__))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue