mirror of
https://github.com/python/cpython
synced 2024-07-21 02:05:18 +00:00
Committing Tim's patch for SF bug #983585:
test_repr() fails with id() values that appear negative
This commit is contained in:
parent
ac1075a645
commit
83a6430717
|
@ -111,8 +111,7 @@ def repr_instance(self, x, level):
|
|||
# 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)
|
||||
|
|
Loading…
Reference in a new issue