diff options
| author | Claude Paroz <claude@2xlibre.net> | 2016-12-29 16:27:49 +0100 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2017-01-18 20:18:46 +0100 |
| commit | 7b2f2e74adb36a4334e83130f6abc2f79d395235 (patch) | |
| tree | 313387ba6a6f1311b43cf5fb4f2576d2d6c4f805 /django/utils/safestring.py | |
| parent | f6acd1d271122d66de8061e75ae26137ddf02658 (diff) | |
Refs #23919 -- Removed six.<various>_types usage
Thanks Tim Graham and Simon Charette for the reviews.
Diffstat (limited to 'django/utils/safestring.py')
| -rw-r--r-- | django/utils/safestring.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/django/utils/safestring.py b/django/utils/safestring.py index 3f4b3d48fd..609f8f45ac 100644 --- a/django/utils/safestring.py +++ b/django/utils/safestring.py @@ -5,7 +5,6 @@ that the producer of the string has already turned characters that should not be interpreted by the HTML engine (e.g. '<') into the appropriate entities. """ -from django.utils import six from django.utils.functional import Promise, curry, wraps @@ -52,10 +51,10 @@ class SafeBytes(bytes, SafeData): decode = curry(_proxy_method, method=bytes.decode) -class SafeText(six.text_type, SafeData): +class SafeText(str, SafeData): """ - A unicode (Python 2) / str (Python 3) subclass that has been specifically - marked as "safe" for HTML output purposes. + A str subclass that has been specifically marked as "safe" for HTML output + purposes. """ def __add__(self, rhs): """ @@ -80,7 +79,7 @@ class SafeText(six.text_type, SafeData): else: return SafeText(data) - encode = curry(_proxy_method, method=six.text_type.encode) + encode = curry(_proxy_method, method=str.encode) SafeString = SafeText @@ -106,7 +105,7 @@ def mark_safe(s): return s if isinstance(s, bytes) or (isinstance(s, Promise) and s._delegate_bytes): return SafeBytes(s) - if isinstance(s, (six.text_type, Promise)): + if isinstance(s, (str, Promise)): return SafeText(s) if callable(s): return _safety_decorator(mark_safe, s) |
