Fix invalid backslash characters

* https://docs.python.org/3/whatsnew/3.6.html#deprecated-python-behavior

Signed-off-by: Alfred Wingate <parona@protonmail.com>
This commit is contained in:
Alfred Wingate
2023-11-16 05:10:40 +02:00
parent d48699e5fd
commit c0be0e0b67
9 changed files with 19 additions and 19 deletions

View File

@@ -122,7 +122,7 @@ def scan_directory_recursive(cp, ver, rev, url, steps, orig_url, options):
results = []
if re.search(b"<\s*a\s+[^>]*href", data, re.I):
if re.search(rb"<\s*a\s+[^>]*href", data, re.I):
results.extend(scan_html(data, url, pattern))
elif url.startswith("ftp://"):
results.extend(scan_ftp(data, url, pattern))

View File

@@ -20,7 +20,7 @@ def can_handle(pkg, url=None):
def guess_package_and_channel(cp, url):
match = re.search("http://(.*)\.php\.net/get/(.*)-(.*).tgz", url)
match = re.search(r"http://(.*)\.php\.net/get/(.*)-(.*).tgz", url)
if match:
host = match.group(1)

View File

@@ -19,7 +19,7 @@ def can_handle(pkg, url=None):
def guess_package(cp, url):
match = re.search("mirror://pypi/\w+/(.*)/.*", url)
match = re.search(r"mirror://pypi/\w+/(.*)/.*", url)
if match:
return match.group(1)

View File

@@ -24,7 +24,7 @@ def can_handle(*args):
def handle_directory_patterns(base, file_pattern):
"""
r"""
Directory pattern matching
e.g.: base: ftp://ftp.nessus.org/pub/nessus/nessus-([\d\.]+)/src/
file_pattern: nessus-core-([\d\.]+)\.tar\.gz