From a5e9e427f6ab80c8c7fca104689fcac46696a39b Mon Sep 17 00:00:00 2001 From: Thierry Parmentelat Date: Mon, 25 Nov 2024 09:01:41 +0100 Subject: [PATCH] use raw strings with re.compile --- PLC/Persons.py | 2 +- migrations/extract-views.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PLC/Persons.py b/PLC/Persons.py index bc4b4c1e..6e1b2400 100644 --- a/PLC/Persons.py +++ b/PLC/Persons.py @@ -78,7 +78,7 @@ class Person(Row): if not email: raise invalid_email - email_re = re.compile('\A[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9._\-]+\.[a-zA-Z]+\Z') + email_re = re.compile(r'\A[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9._\-]+\.[a-zA-Z]+\Z') if not email_re.match(email): raise invalid_email diff --git a/migrations/extract-views.py b/migrations/extract-views.py index 4a204651..59089e10 100755 --- a/migrations/extract-views.py +++ b/migrations/extract-views.py @@ -10,9 +10,9 @@ class Schema: self.output=output # left part is non-greedy - comment = re.compile("(.*?)--.*") - spaces = re.compile("^\s+(\S.*)") - view = re.compile("(?i)\s*create\s+(or\s+replace)?\s+view.*") + comment = re.compile(r"(.*?)--.*") + spaces = re.compile(r"^\s+(\S.*)") + view = re.compile(r"(?i)\s*create\s+(or\s+replace)?\s+view.*") def parse (self): if self.output: -- 2.47.0