summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorFred Drake <fdrake@acm.org>2004-07-01 20:28:47 (GMT)
committerFred Drake <fdrake@acm.org>2004-07-01 20:28:47 (GMT)
commit83a643071785959658f7e844ba1a341a7d9a7f46 (patch)
treebb42d1fa0a302e42cfa7b595300f04df729c8fc1 /Lib
parentac1075a645e2c0bb26b1d5fbab0df0afa09d59a2 (diff)
downloadcpython-83a643071785959658f7e844ba1a341a7d9a7f46.zip
cpython-83a643071785959658f7e844ba1a341a7d9a7f46.tar.gz
cpython-83a643071785959658f7e844ba1a341a7d9a7f46.tar.bz2
Committing Tim's patch for SF bug #983585:
test_repr() fails with id() values that appear negative
Diffstat (limited to 'Lib')
-rw-r--r--Lib/repr.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/repr.py b/Lib/repr.py
index 8a86682..53b5207 100644
--- a/Lib/repr.py
+++ b/Lib/repr.py
@@ -111,8 +111,7 @@ class Repr:
# Bugs in x.__repr__() can cause arbitrary
# exceptions -- then make up something
except:
- return '<' + x.__class__.__name__ + ' instance at ' + \
- hex(id(x))[2:] + '>'
+ return '<%s instance at %x>' % (x.__class__.__name__, id(x))
if len(s) > self.maxstring:
i = max(0, (self.maxstring-3)//2)
j = max(0, self.maxstring-3-i)