Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Avoided importing _mysql directly. Refs #17755.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17602 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit c471cfd67425a6394a6f91bf6e71573e8f482850 1 parent 97061bd
@aaugustin aaugustin authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 django/db/backends/mysql/base.py
View
5 django/db/backends/mysql/base.py
@@ -23,9 +23,8 @@
from django.core.exceptions import ImproperlyConfigured
raise ImproperlyConfigured("MySQLdb-1.2.1p2 or newer is required; you have %s" % Database.__version__)
-from MySQLdb.converters import conversions
+from MySQLdb.converters import conversions, Thing2Literal
from MySQLdb.constants import FIELD_TYPE, CLIENT
-from _mysql import string_literal
from django.db import utils
from django.db.backends import *
@@ -66,7 +65,7 @@ def adapt_datetime_with_timezone_support(value, conv):
default_timezone = timezone.get_default_timezone()
value = timezone.make_aware(value, default_timezone)
value = value.astimezone(timezone.utc).replace(tzinfo=None)
- return string_literal(value.strftime("%Y-%m-%d %H:%M:%S"), conv)
+ return Thing2Literal(value.strftime("%Y-%m-%d %H:%M:%S"), conv)
# 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 --
Please sign in to comment.
Something went wrong with that request. Please try again.