diff options
author | Fred Drake <fdrake@acm.org> | 2004-07-01 20:28:47 (GMT) |
---|---|---|
committer | Fred Drake <fdrake@acm.org> | 2004-07-01 20:28:47 (GMT) |
commit | 83a643071785959658f7e844ba1a341a7d9a7f46 (patch) | |
tree | bb42d1fa0a302e42cfa7b595300f04df729c8fc1 /Lib/repr.py | |
parent | ac1075a645e2c0bb26b1d5fbab0df0afa09d59a2 (diff) | |
download | cpython-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/repr.py')
-rw-r--r-- | Lib/repr.py | 3 |
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) |