From 61c850219fe25ac7ffd13f1473829528171dd35a Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Fri, 30 Dec 2022 13:07:10 +0100 Subject: Use raw strings This avoids escaping issues --- whatmaps/debianpkg.py | 2 +- whatmaps/redhatdistro.py | 2 +- whatmaps/rpmpkg.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/whatmaps/debianpkg.py b/whatmaps/debianpkg.py index 0192513..0e1301f 100644 --- a/whatmaps/debianpkg.py +++ b/whatmaps/debianpkg.py @@ -22,7 +22,7 @@ from . pkg import Pkg class DebianPkg(Pkg): type = 'Debian' - _init_script_re = re.compile('/etc/init.d/[\w\-\.]') + _init_script_re = re.compile(r'/etc/init.d/[\w\-\.]') _list_contents = ['dpkg-query', '-L', '${pkg_name}'] def __init__(self, name): diff --git a/whatmaps/redhatdistro.py b/whatmaps/redhatdistro.py index 0f0c42d..12336e6 100644 --- a/whatmaps/redhatdistro.py +++ b/whatmaps/redhatdistro.py @@ -25,7 +25,7 @@ from . rpmpkg import RpmPkg class RedHatDistro(Distro): """RPM based distribution""" _pkg_re = re.compile(r'(?P[\w\-\+]+)-(?P[\w\.]+)' - '-(?P[\w\.]+)\.(?P.+)') + r'-(?P[\w\.]+)\.(?P.+)') @classmethod def pkg(klass, name): diff --git a/whatmaps/rpmpkg.py b/whatmaps/rpmpkg.py index 493dd5a..3940931 100644 --- a/whatmaps/rpmpkg.py +++ b/whatmaps/rpmpkg.py @@ -22,7 +22,7 @@ from . pkg import Pkg class RpmPkg(Pkg): type = 'RPM' - _init_script_re = re.compile('/etc/rc.d/init.d/[\w\-\.]') + _init_script_re = re.compile(r'/etc/rc.d/init.d/[\w\-\.]') _list_contents = ['rpm', '-ql', '$pkg_name'] def __init__(self, name): -- cgit v1.2.3