moved from MySQLdb to pymysql (#11462)

This commit is contained in:
Achilles Rasquinha 2017-11-08 11:33:24 +05:30 committed by Nabin Hait
parent 36e2fb8d58
commit 7fd20f303f
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
import frappe import frappe
from MySQLdb import OperationalError from pymysql import InternalError
def execute(): def execute():
frappe.reload_doctype("Journal Entry Account") frappe.reload_doctype("Journal Entry Account")
@ -15,6 +15,6 @@ def execute():
frappe.db.sql("""update `tabJournal Entry Account` frappe.db.sql("""update `tabJournal Entry Account`
set reference_type=%s, reference_name={0} where ifnull({0}, '') != '' set reference_type=%s, reference_name={0} where ifnull({0}, '') != ''
""".format(fieldname), doctype) """.format(fieldname), doctype)
except OperationalError: except InternalError:
# column not found # column not found
pass pass

View File

@ -3,7 +3,7 @@
from __future__ import print_function, unicode_literals from __future__ import print_function, unicode_literals
import frappe import frappe
import MySQLdb from frappe.exceptions import SQLError
def execute(): def execute():
""" """
@ -31,7 +31,7 @@ def execute():
try: try:
migrate_item_variants() migrate_item_variants()
except MySQLdb.ProgrammingError: except SQLError:
print("`tabItem Variant` not found") print("`tabItem Variant` not found")
def rename_and_reload_doctypes(): def rename_and_reload_doctypes():