Explorar el Código

Replaced types import with six (#3834)

Importing six.text_type instead of types.UnicodeType and
six.binary_type instead of types.StringType
version-14
Aditya Hase hace 8 años
committed by Rushabh Mehta
padre
commit
7c9c53840a
Se han modificado 1 ficheros con 3 adiciones y 3 borrados
  1. +3
    -3
      frappe/database.py

+ 3
- 3
frappe/database.py Ver fichero

@@ -18,7 +18,7 @@ import redis
import frappe.model.meta import frappe.model.meta
from frappe.utils import now, get_datetime, cstr from frappe.utils import now, get_datetime, cstr
from frappe import _ 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.utils.global_search import sync_global_search
from frappe.model.utils.link_count import flush_local_link_count from frappe.model.utils.link_count import flush_local_link_count
from six import iteritems, text_type from six import iteritems, text_type
@@ -69,8 +69,8 @@ class Database:
use_unicode=True, charset='utf8mb4') use_unicode=True, charset='utf8mb4')
self._conn.converter[246]=float self._conn.converter[246]=float
self._conn.converter[12]=get_datetime 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 MYSQL_OPTION_MULTI_STATEMENTS_OFF = 1
self._conn.set_server_option(MYSQL_OPTION_MULTI_STATEMENTS_OFF) self._conn.set_server_option(MYSQL_OPTION_MULTI_STATEMENTS_OFF)


Cargando…
Cancelar
Guardar