removed use of backticks for repr for python3 compatibility

This commit is contained in:
heartsucker 2019-04-18 13:50:21 +02:00
parent 48a2b42ec1
commit c0939e9b99
No known key found for this signature in database
GPG Key ID: C49FAAAA25756E79
3 changed files with 3 additions and 2 deletions

1
newsfragments/3027.other Normal file
View File

@ -0,0 +1 @@
Removed used of backticks for "repr" for Python3 compatibility.

View File

@ -12,7 +12,7 @@ class T(unittest.TestCase):
def _test_ende(self, bs):
ascii=base62.b2a(bs)
bs2=base62.a2b(ascii)
assert bs2 == bs, "bs2: %s:%s, bs: %s:%s, ascii: %s:%s" % (len(bs2), `bs2`, len(bs), `bs`, len(ascii), `ascii`)
assert bs2 == bs, "bs2: %s:%s, bs: %s:%s, ascii: %s:%s" % (len(bs2), repr(bs2), len(bs), repr(bs), len(ascii), repr(ascii))
def test_num_octets_that_encode_to_this_many_chars(self):
return self._test_num_octets_that_encode_to_this_many_chars(2, 1)

View File

@ -26,7 +26,7 @@ class BetterRepr(Repr):
return '<' + obj.im_class.__name__ + '.' + obj.im_func.__name__ + '() at (builtin)'
def repr_long(self, obj, level):
s = `obj` # XXX Hope this isn't too slow...
s = repr(obj) # XXX Hope this isn't too slow...
if len(s) > self.maxlong:
i = max(0, (self.maxlong-3)/2)
j = max(0, self.maxlong-3-i)