1
0
mirror of https://github.com/django/django.git synced 2024-12-23 01:25:58 +00:00

chore: fix debug tests

This commit is contained in:
Keerthi Vasan 2024-06-23 20:55:26 +05:30
parent 65045060ac
commit d68430349e

View File

@ -520,9 +520,12 @@ class DebugRepr(reprlib.Repr):
return s
def print(self, value):
if isinstance(value, Sized) and len(value) > self.limit:
if isinstance(value, Sized):
length = len(value)
if length > self.limit:
self.fillvalue = self.gen_trim_msg(length)
else:
self.fillvalue = ""
else:
self.fillvalue = "..."
return self.repr(value)