From 5f73a980b5603d0b98db538d000a125a6200b517 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 12 Nov 2013 17:28:17 +0530 Subject: [PATCH] [minor] replace 'raise e' with 'raise' for correct tracebacks --- patches/april_2013/p05_update_file_data.py | 2 +- patches/december_2012/file_list_rename.py | 2 +- patches/january_2013/file_list_rename_returns.py | 4 ++-- patches/june_2013/p03_buying_selling_for_price_list.py | 2 +- patches/may_2013/p06_make_notes.py | 2 +- patches/september_2012/add_stock_ledger_entry_index.py | 2 +- patches/september_2013/p01_update_communication.py | 2 +- selling/doctype/quotation/quotation.py | 2 +- setup/doctype/email_settings/email_settings.py | 6 +++--- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/patches/april_2013/p05_update_file_data.py b/patches/april_2013/p05_update_file_data.py index 47d6de9186..69edccae1d 100644 --- a/patches/april_2013/p05_update_file_data.py +++ b/patches/april_2013/p05_update_file_data.py @@ -37,7 +37,7 @@ def update_file_list(doctype, singles): except Exception, e: print webnotes.getTraceback() if (e.args and e.args[0]!=1054) or not e.args: - raise e + raise def update_for_doc(doctype, doc): for filedata in doc.file_list.split("\n"): diff --git a/patches/december_2012/file_list_rename.py b/patches/december_2012/file_list_rename.py index ce4ae76a46..aff687b644 100644 --- a/patches/december_2012/file_list_rename.py +++ b/patches/december_2012/file_list_rename.py @@ -10,4 +10,4 @@ def execute(): webnotes.conn.sql("""update `tab%s` set file_list = replace(file_list, "-", "")""" % dt[0]) except Exception, e: - if e.args[0]!=1146: raise e \ No newline at end of file + if e.args[0]!=1146: raise \ No newline at end of file diff --git a/patches/january_2013/file_list_rename_returns.py b/patches/january_2013/file_list_rename_returns.py index 2325da5279..bce0c9aabf 100644 --- a/patches/january_2013/file_list_rename_returns.py +++ b/patches/january_2013/file_list_rename_returns.py @@ -37,7 +37,7 @@ def execute(): except Exception, e: # if duplicate entry, then dont update if e[0]!=1062: - raise e + raise changed_keys = change_map.keys() @@ -62,5 +62,5 @@ def execute(): except Exception, e: if e[0]!=1146: - raise e + raise \ No newline at end of file diff --git a/patches/june_2013/p03_buying_selling_for_price_list.py b/patches/june_2013/p03_buying_selling_for_price_list.py index 61cddd0b28..58096c5c14 100644 --- a/patches/june_2013/p03_buying_selling_for_price_list.py +++ b/patches/june_2013/p03_buying_selling_for_price_list.py @@ -25,4 +25,4 @@ def execute(): webnotes.conn.sql("""update `tabPrice List` set buying_or_selling='Selling' where ifnull(buying_or_selling, '')='' """) else: - raise e \ No newline at end of file + raise \ No newline at end of file diff --git a/patches/may_2013/p06_make_notes.py b/patches/may_2013/p06_make_notes.py index 29bfe25da4..0f98f54c6e 100644 --- a/patches/may_2013/p06_make_notes.py +++ b/patches/may_2013/p06_make_notes.py @@ -33,7 +33,7 @@ def execute(): pass except Exception, e: if e.args[0] != 1062: - raise e + raise webnotes.delete_doc("DocType", "Question") webnotes.delete_doc("DocType", "Answer") diff --git a/patches/september_2012/add_stock_ledger_entry_index.py b/patches/september_2012/add_stock_ledger_entry_index.py index dc3ed964dd..d272f5ad6a 100644 --- a/patches/september_2012/add_stock_ledger_entry_index.py +++ b/patches/september_2012/add_stock_ledger_entry_index.py @@ -10,6 +10,6 @@ def execute(): webnotes.conn.sql("""alter table `tabStock Ledger Entry` add index posting_sort_index(posting_date, posting_time, name)""") webnotes.conn.commit() except Exception, e: - if e.args[0]!=1061: raise e + if e.args[0]!=1061: raise webnotes.conn.begin() \ No newline at end of file diff --git a/patches/september_2013/p01_update_communication.py b/patches/september_2013/p01_update_communication.py index 31317384a2..4b9cac28dc 100644 --- a/patches/september_2013/p01_update_communication.py +++ b/patches/september_2013/p01_update_communication.py @@ -19,4 +19,4 @@ def execute(): where ifnull(`%s`, '')!=''""" % ("%s", fieldname, fieldname), doctype) except MySQLdb.OperationalError, e: if e.args[0] != 1054: - raise e + raise diff --git a/selling/doctype/quotation/quotation.py b/selling/doctype/quotation/quotation.py index 53531278e4..546ff02b36 100644 --- a/selling/doctype/quotation/quotation.py +++ b/selling/doctype/quotation/quotation.py @@ -168,7 +168,7 @@ def _make_customer(source_name, ignore_permissions=False): customer.insert() return customer else: - raise e + raise except webnotes.MandatoryError: from webnotes.utils import get_url_to_form webnotes.throw(_("Before proceeding, please create Customer from Lead") + \ diff --git a/setup/doctype/email_settings/email_settings.py b/setup/doctype/email_settings/email_settings.py index aa511eefcd..2aa422c7cb 100644 --- a/setup/doctype/email_settings/email_settings.py +++ b/setup/doctype/email_settings/email_settings.py @@ -52,7 +52,7 @@ class DocType: inc_email.password = self.doc.support_password except AttributeError, e: webnotes.msgprint(err_msg) - raise e + raise pop_mb = POP3Mailbox(inc_email) @@ -61,7 +61,7 @@ class DocType: except _socket.error, e: # Invalid mail server -- due to refusing connection webnotes.msgprint('Invalid POP3 Mail Server. Please rectify and try again.') - raise e + raise except poplib.error_proto, e: webnotes.msgprint('Invalid User Name or Support Password. Please rectify and try again.') - raise e + raise