mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-01-24 16:24:18 +03:00
Fix smart_repr()
to also clean upper-case hex addresses.
Windows Pythons seem to like printing addresses in upper-case, while Linux Pythons like lower-case hexes. This led to an amusing (for a given value of "amusing", anyway) situation where some repr tests would fail if the objects they were testing happened to be allocated at an address with a hex digit in the range A..F.
This commit is contained in:
parent
bdf9c4997d
commit
47c9bb143c
|
@ -40,7 +40,7 @@ def smart_repr(value):
|
|||
# <django.core.validators.RegexValidator object at 0x1047af050>
|
||||
# Should be presented as
|
||||
# <django.core.validators.RegexValidator object>
|
||||
value = re.sub(' at 0x[0-9a-f]{4,32}>', '>', value)
|
||||
value = re.sub(' at 0x[0-9A-Fa-f]{4,32}>', '>', value)
|
||||
|
||||
return value
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user