From 7c9c53840ac1362afee4229184db88ee63d36e3d Mon Sep 17 00:00:00 2001 From: Aditya Hase Date: Wed, 2 Aug 2017 17:04:56 +0530 Subject: [PATCH] Replaced types import with six (#3834) Importing six.text_type instead of types.UnicodeType and six.binary_type instead of types.StringType --- frappe/database.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frappe/database.py b/frappe/database.py index eebaf3fbb7..af265b5857 100644 --- a/frappe/database.py +++ b/frappe/database.py @@ -18,7 +18,7 @@ import redis import frappe.model.meta from frappe.utils import now, get_datetime, cstr from frappe import _ -from types import StringType, UnicodeType +from six import text_type, binary_type from frappe.utils.global_search import sync_global_search from frappe.model.utils.link_count import flush_local_link_count from six import iteritems, text_type @@ -69,8 +69,8 @@ class Database: use_unicode=True, charset='utf8mb4') self._conn.converter[246]=float self._conn.converter[12]=get_datetime - self._conn.encoders[UnicodeWithAttrs] = self._conn.encoders[UnicodeType] - self._conn.encoders[DateTimeDeltaType] = self._conn.encoders[StringType] + self._conn.encoders[UnicodeWithAttrs] = self._conn.encoders[text_type] + self._conn.encoders[DateTimeDeltaType] = self._conn.encoders[binary_type] MYSQL_OPTION_MULTI_STATEMENTS_OFF = 1 self._conn.set_server_option(MYSQL_OPTION_MULTI_STATEMENTS_OFF)