From 3754f4ad410640382f9fe25073da03009cdc2ea3 Mon Sep 17 00:00:00 2001 From: Baptiste Mispelon Date: Fri, 27 Sep 2013 17:00:42 +0200 Subject: Fix #21185: Added tests for unescape_entities. Also fixed a py3 incompatibility. Thanks to brutasse for the report. --- django/utils/text.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'django') diff --git a/django/utils/text.py b/django/utils/text.py index eeff5c5a2e..93c33b3351 100644 --- a/django/utils/text.py +++ b/django/utils/text.py @@ -365,12 +365,12 @@ def _replace_entity(match): c = int(text[1:], 16) else: c = int(text) - return unichr(c) + return six.unichr(c) except ValueError: return match.group(0) else: try: - return unichr(html_entities.name2codepoint[text]) + return six.unichr(html_entities.name2codepoint[text]) except (ValueError, KeyError): return match.group(0) -- cgit v1.3