diff options
| author | Vytis Banaitis <vytis.banaitis@gmail.com> | 2017-02-01 01:31:17 +0200 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-01-31 18:31:17 -0500 |
| commit | 84126f2789542b7dfe68ac6cb3a088e3a072db0d (patch) | |
| tree | 502184798fbea1a64a850a193fe2389fdb7d80e2 | |
| parent | ed3215ad53c0b22c58883f97286a878c577e25d6 (diff) | |
Refs #23919 -- Removed unneeded code in force_text().
Unneeded since 7b2f2e74adb36a4334e83130f6abc2f79d395235.
| -rw-r--r-- | django/utils/encoding.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/django/utils/encoding.py b/django/utils/encoding.py index ed0a97e5eb..32206d74be 100644 --- a/django/utils/encoding.py +++ b/django/utils/encoding.py @@ -62,13 +62,10 @@ def force_text(s, encoding='utf-8', strings_only=False, errors='strict'): if strings_only and is_protected_type(s): return s try: - if not issubclass(type(s), str): - if isinstance(s, bytes): - s = str(s, encoding, errors) - else: - s = str(s) + if isinstance(s, bytes): + s = str(s, encoding, errors) else: - str(s, encoding, errors) + s = str(s) except UnicodeDecodeError as e: if not isinstance(s, Exception): raise DjangoUnicodeDecodeError(s, *e.args) |
