mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +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
1 changed files with 1 additions and 2 deletions
|
|
@ -111,8 +111,7 @@ class Repr:
|
||||||
# Bugs in x.__repr__() can cause arbitrary
|
# Bugs in x.__repr__() can cause arbitrary
|
||||||
# exceptions -- then make up something
|
# exceptions -- then make up something
|
||||||
except:
|
except:
|
||||||
return '<' + x.__class__.__name__ + ' instance at ' + \
|
return '<%s instance at %x>' % (x.__class__.__name__, id(x))
|
||||||
hex(id(x))[2:] + '>'
|
|
||||||
if len(s) > self.maxstring:
|
if len(s) > self.maxstring:
|
||||||
i = max(0, (self.maxstring-3)//2)
|
i = max(0, (self.maxstring-3)//2)
|
||||||
j = max(0, self.maxstring-3-i)
|
j = max(0, self.maxstring-3-i)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue