diff options
author | Guido Günther <agx@sigxcpu.org> | 2022-12-30 13:07:10 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2022-12-30 13:08:05 +0100 |
commit | 61c850219fe25ac7ffd13f1473829528171dd35a (patch) | |
tree | b33c95a631e3bce627a6fee26070b135e4a72365 | |
parent | 825ad6bc42a7fb92d9308653173a08484f8bcef2 (diff) |
Use raw strings
This avoids escaping issues
-rw-r--r-- | whatmaps/debianpkg.py | 2 | ||||
-rw-r--r-- | whatmaps/redhatdistro.py | 2 | ||||
-rw-r--r-- | 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<pkg>[\w\-\+]+)-(?P<ver>[\w\.]+)' - '-(?P<rel>[\w\.]+)\.(?P<arch>.+)') + r'-(?P<rel>[\w\.]+)\.(?P<arch>.+)') @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): |