fix: Hide all warnings in frappe commands
Hide all warnings when triggered via frappe.utils.bench_helper
This commit is contained in:
parent
6365037b81
commit
2dde3a9b01
2 changed files with 2 additions and 4 deletions
|
|
@ -501,8 +501,6 @@ frappe.db.connect()
|
|||
@pass_context
|
||||
def console(context):
|
||||
"Start ipython console for a site"
|
||||
import warnings
|
||||
|
||||
site = get_site(context)
|
||||
frappe.init(site=site)
|
||||
frappe.connect()
|
||||
|
|
@ -523,7 +521,6 @@ def console(context):
|
|||
if failed_to_import:
|
||||
print("\nFailed to import:\n{}".format(", ".join(failed_to_import)))
|
||||
|
||||
warnings.simplefilter('ignore')
|
||||
IPython.embed(display_banner="", header="", colors="neutral")
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import json
|
|||
import importlib
|
||||
import frappe.utils
|
||||
import traceback
|
||||
import warnings
|
||||
|
||||
click.disable_unicode_literals_warning = True
|
||||
|
||||
|
|
@ -98,5 +99,5 @@ def get_apps():
|
|||
return frappe.get_all_apps(with_internal_apps=False, sites_path='.')
|
||||
|
||||
if __name__ == "__main__":
|
||||
warnings.simplefilter('ignore')
|
||||
main()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue