Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Better TypeError message.
  • Loading branch information
serhiy-storchaka committed Aug 11, 2019
commit a587d7d890f137f196ea2de650d324889d5eac5d
4 changes: 2 additions & 2 deletions Lib/fractions.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ def __new__(cls, numerator=0, denominator=None, *, _normalize=True):
self._numerator, self._denominator = math.as_integer_ratio(numerator)
return self
except TypeError:
raise TypeError("argument should be a string "
"or a Rational instance")
raise TypeError("argument should be a string or a number, "
"not %s" % type(numerator).__name__) from None

elif type(numerator) is int is type(denominator):
pass # *very* normal case
Expand Down