diff options
| author | Tim Graham <timograham@gmail.com> | 2017-01-23 10:36:48 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2017-01-24 08:35:06 -0500 |
| commit | 5b95d421f7ab8deadaf3c1ad3f341bdfc85bfca4 (patch) | |
| tree | d005b8a508c4202bb8b78763f84fd0fe67a51e82 | |
| parent | a87d6b69a75d0f9a66652e3f0bd1c2c85624c7d5 (diff) | |
Refs #23919 -- Removed a MySQLdb workaround (refs #6052) for Python 2.
| -rw-r--r-- | django/db/backends/mysql/base.py | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index 60cf4b9df5..76a4313a72 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -10,7 +10,6 @@ from django.db import utils from django.db.backends import utils as backend_utils from django.db.backends.base.base import BaseDatabaseWrapper from django.utils.functional import cached_property -from django.utils.safestring import SafeBytes, SafeText try: import MySQLdb as Database @@ -43,9 +42,7 @@ if (version < (1, 2, 1) or ( # MySQLdb-1.2.1 returns TIME columns as timedelta -- they are more like # timedelta in terms of actual behavior as they are signed and include days -- -# and Django expects time, so we still need to override that. We also need to -# add special handling for SafeText and SafeBytes as MySQLdb's type -# checking is too tight to catch those (see Django ticket #6052). +# and Django expects time. django_conversions = conversions.copy() django_conversions.update({ FIELD_TYPE.TIME: backend_utils.typecast_time, @@ -249,10 +246,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): return kwargs def get_new_connection(self, conn_params): - conn = Database.connect(**conn_params) - conn.encoders[SafeText] = conn.encoders[str] - conn.encoders[SafeBytes] = conn.encoders[bytes] - return conn + return Database.connect(**conn_params) def init_connection_state(self): assignments = [] |
