From: Fred Drake Date: Thu, 1 Jul 2004 20:28:47 +0000 (+0000) Subject: Committing Tim's patch for SF bug #983585: X-Git-Tag: v2.4a1~79 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=83a643071785959658f7e844ba1a341a7d9a7f46;p=thirdparty%2FPython%2Fcpython.git Committing Tim's patch for SF bug #983585: test_repr() fails with id() values that appear negative --- diff --git a/Lib/repr.py b/Lib/repr.py index 8a86682633bf..53b5207e5f61 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)