diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2018-09-25 06:53:13 -0700 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-09-25 09:53:13 -0400 |
| commit | 1d65ddd9c357b7018c616ecb0369d47eeb92c3a3 (patch) | |
| tree | d83d63c82849202ba2992a71f640c72dd800c230 /django/db/backends/utils.py | |
| parent | ad9a28ee38e3352b16cc6c9ae7f55f90c64710cc (diff) | |
Refs #27795 -- Removed force_bytes() usage in db/backends/utils.py.
Diffstat (limited to 'django/db/backends/utils.py')
| -rw-r--r-- | django/db/backends/utils.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/django/db/backends/utils.py b/django/db/backends/utils.py index 2c404b3a0b..a762175025 100644 --- a/django/db/backends/utils.py +++ b/django/db/backends/utils.py @@ -7,7 +7,6 @@ from time import time from django.conf import settings from django.db.utils import NotSupportedError -from django.utils.encoding import force_bytes from django.utils.timezone import utc logger = logging.getLogger('django.db.backends') @@ -214,7 +213,7 @@ def truncate_name(identifier, length=None, hash_len=4): if length is None or len(name) <= length: return identifier - digest = hashlib.md5(force_bytes(name)).hexdigest()[:hash_len] + digest = hashlib.md5(name.encode()).hexdigest()[:hash_len] return '%s%s%s' % ('%s"."' % namespace if namespace else '', name[:length - hash_len], digest) |
