fix: DeprecationWarning: invalid escape sequence \<
Python 3 interprets string literals as Unicode strings, and therefore your \< and \> are treated as an escaped Unicode character. Declare your RegEx pattern as a raw string instead by prepending r
This commit is contained in:
parent
d84d02349c
commit
9795545fb6
1 changed files with 2 additions and 2 deletions
|
|
@ -34,10 +34,10 @@ def get_context(context):
|
|||
boot_json = frappe.as_json(boot)
|
||||
|
||||
# remove script tags from boot
|
||||
boot_json = re.sub("\<script[^<]*\</script\>", "", boot_json)
|
||||
boot_json = re.sub(r"\<script[^<]*\</script\>", "", boot_json)
|
||||
|
||||
# TODO: Find better fix
|
||||
boot_json = re.sub("</script\>", "", boot_json)
|
||||
boot_json = re.sub(r"</script\>", "", boot_json)
|
||||
|
||||
context.update({
|
||||
"no_cache": 1,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue