From a13d208a281a061568beda82eea111d283ea05df Mon Sep 17 00:00:00 2001 From: Joseph Marie Alba Date: Sun, 16 May 2021 06:20:44 +0800 Subject: [PATCH] fix: DeprecationWarning: invalid escape sequence \( Python 3 interprets string literals as Unicode strings, and therefore \( is treated as an escaped Unicode character. Declare RegEx pattern as a raw string instead by prepending r --- frappe/www/printview.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frappe/www/printview.py b/frappe/www/printview.py index 04e846c41d..3ddf032e9e 100644 --- a/frappe/www/printview.py +++ b/frappe/www/printview.py @@ -409,7 +409,7 @@ def get_print_style(style=None, print_format=None, for_legacy=False): css = css + '\n' + frappe.db.get_value('Print Style', style, 'css') # move @import to top - for at_import in list(set(re.findall("(@import url\([^\)]+\)[;]?)", css))): + for at_import in list(set(re.findall(r"(@import url\([^\)]+\)[;]?)", css))): css = css.replace(at_import, "") # prepend css with at_import