diff --git a/erpnext/patches/v5_4/cleanup_journal_entry.py b/erpnext/patches/v5_4/cleanup_journal_entry.py index a0c332324d2..9100b8f4a88 100644 --- a/erpnext/patches/v5_4/cleanup_journal_entry.py +++ b/erpnext/patches/v5_4/cleanup_journal_entry.py @@ -1,5 +1,5 @@ import frappe -from MySQLdb import OperationalError +from pymysql import InternalError def execute(): frappe.reload_doctype("Journal Entry Account") @@ -15,6 +15,6 @@ def execute(): frappe.db.sql("""update `tabJournal Entry Account` set reference_type=%s, reference_name={0} where ifnull({0}, '') != '' """.format(fieldname), doctype) - except OperationalError: + except InternalError: # column not found pass diff --git a/erpnext/patches/v5_7/item_template_attributes.py b/erpnext/patches/v5_7/item_template_attributes.py index 22b15d32ae2..6aa81f79b29 100644 --- a/erpnext/patches/v5_7/item_template_attributes.py +++ b/erpnext/patches/v5_7/item_template_attributes.py @@ -3,7 +3,7 @@ from __future__ import print_function, unicode_literals import frappe -import MySQLdb +from frappe.exceptions import SQLError def execute(): """ @@ -31,7 +31,7 @@ def execute(): try: migrate_item_variants() - except MySQLdb.ProgrammingError: + except SQLError: print("`tabItem Variant` not found") def rename_and_reload_doctypes():