]> granicus.if.org Git - python/commitdiff
Committing Tim's patch for SF bug #983585:
authorFred Drake <fdrake@acm.org>
Thu, 1 Jul 2004 20:28:47 +0000 (20:28 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 1 Jul 2004 20:28:47 +0000 (20:28 +0000)
test_repr() fails with id() values that appear negative

Lib/repr.py

index 8a86682633bfa34877f46b710c0d47f5864adafc..53b5207e5f615d6c8058377138588e1f8f057f56 100644 (file)
@@ -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)