Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
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.
  • Loading branch information
akx committed Nov 26, 2015
commit 47c9bb143c3121048957d1078525caaee9f4a10e
2 changes: 1 addition & 1 deletion rest_framework/utils/representation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down