summaryrefslogtreecommitdiff
path: root/Lib/fractions.py
diff options
context:
space:
mode:
authorAndrew M. Kuchling <amk@amk.ca>2008-06-21 13:47:20 +0000
committerAndrew M. Kuchling <amk@amk.ca>2008-06-21 13:47:20 +0000
commitf484363baecbe69def74a4535cb9545869424dcb (patch)
tree6c7d1278b98589ceeb126fd342bd24537f9e52ae /Lib/fractions.py
parentd897264464ba153c1c50c0745199392fab796eff (diff)
downloadcpython-git-f484363baecbe69def74a4535cb9545869424dcb.tar.gz
Use repr() for bad input strings; this makes the empty string or binary characters more visible
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 0d85f15d6c..f06e4d4038 100755
--- a/Lib/fractions.py
+++ b/Lib/fractions.py
@@ -70,7 +70,7 @@ class Fraction(Rational):
input = numerator
m = _RATIONAL_FORMAT.match(input)
if m is None:
- raise ValueError('Invalid literal for Fraction: ' + input)
+ raise ValueError('Invalid literal for Fraction: %r' % input)
numerator = m.group('num')
decimal = m.group('decimal')
if decimal: