perf: Remove Jinja from import tree
This commit is contained in:
parent
bbac844de7
commit
a708ba4b94
1 changed files with 2 additions and 1 deletions
|
|
@ -17,7 +17,6 @@ from frappe.utils import cstr
|
|||
import frappe, os, re, io, codecs, json
|
||||
from frappe.model.utils import render_include, InvalidIncludePath
|
||||
from frappe.utils import strip, strip_html_tags, is_html
|
||||
from jinja2 import TemplateError
|
||||
import itertools, operator
|
||||
|
||||
def guess_language(lang_list=None):
|
||||
|
|
@ -526,6 +525,8 @@ def extract_messages_from_code(code):
|
|||
:param code: code from which translatable files are to be extracted
|
||||
:param is_py: include messages in triple quotes e.g. `_('''message''')`
|
||||
"""
|
||||
from jinja2 import TemplateError
|
||||
|
||||
try:
|
||||
code = frappe.as_unicode(render_include(code))
|
||||
except (TemplateError, ImportError, InvalidIncludePath, IOError):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue