[09/11] Resolve Python 3.6 warnings

Message ID 20180624195557.19909-9-stephen@that.guru
State New
Headers show
Series
  • [01/11] REST: Check.user is not read-only
Related show

Commit Message

Stephen Finucane June 24, 2018, 7:55 p.m.
DeprecationWarning: invalid escape sequence \d

Signed-off-by: Stephen Finucane <stephen@that.guru>
---
 patchwork/parser.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Daniel Axtens July 12, 2018, 5:54 a.m. | #1
Stephen Finucane <stephen@that.guru> writes:

Ergh, I though I had got these. Oh well.

Reviewed-by: Daniel Axtens <dja@axtens.net>

Regards,
Daniel

> DeprecationWarning: invalid escape sequence \d
>
> Signed-off-by: Stephen Finucane <stephen@that.guru>
> ---
>  patchwork/parser.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/patchwork/parser.py b/patchwork/parser.py
> index a40f9314..2a31c140 100644
> --- a/patchwork/parser.py
> +++ b/patchwork/parser.py
> @@ -486,7 +486,7 @@ def parse_version(subject, subject_prefixes):
>      Returns:
>          version if found, else 1
>      """
> -    regex = re.compile('^[vV](\d+)$')
> +    regex = re.compile(r'^[vV](\d+)$')
>      m = _find_matching_prefix(subject_prefixes, regex)
>      if m:
>          return int(m.group(1))
> -- 
> 2.17.1
>
> _______________________________________________
> Patchwork mailing list
> Patchwork@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/patchwork

Patch

diff --git a/patchwork/parser.py b/patchwork/parser.py
index a40f9314..2a31c140 100644
--- a/patchwork/parser.py
+++ b/patchwork/parser.py
@@ -486,7 +486,7 @@  def parse_version(subject, subject_prefixes):
     Returns:
         version if found, else 1
     """
-    regex = re.compile('^[vV](\d+)$')
+    regex = re.compile(r'^[vV](\d+)$')
     m = _find_matching_prefix(subject_prefixes, regex)
     if m:
         return int(m.group(1))