summaryrefslogtreecommitdiff
path: root/buildtools
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2023-01-19 08:30:19 +0100
committerAndreas Schneider <asn@cryptomilk.org>2023-01-20 09:06:49 +0000
commit253891032eefc3a2651a88f0aba7a619948b7642 (patch)
tree5514fe4c2b276d80587dfa617195212a3dc57fc5 /buildtools
parent91f1567cdcaed3a8f8faf4e77616553308a5f8eb (diff)
downloadsamba-253891032eefc3a2651a88f0aba7a619948b7642.tar.gz
python: Don't use deprecated escape sequences
Certain escape sequences are not valid in Python string literals, and will eventually result in a SyntaxError. Follow up patch of 5045382c6dd04b1bae0eaaae823be908213ff079 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Jan 20 09:06:49 UTC 2023 on atb-devel-224
Diffstat (limited to 'buildtools')
-rw-r--r--buildtools/wafsamba/configure_file.py4
-rw-r--r--buildtools/wafsamba/pkgconfig.py4
-rw-r--r--buildtools/wafsamba/samba_abi.py12
-rw-r--r--buildtools/wafsamba/samba_conftests.py2
-rw-r--r--buildtools/wafsamba/samba_headers.py2
-rw-r--r--buildtools/wafsamba/samba_utils.py4
-rw-r--r--buildtools/wafsamba/symbols.py4
7 files changed, 16 insertions, 16 deletions
diff --git a/buildtools/wafsamba/configure_file.py b/buildtools/wafsamba/configure_file.py
index 6ad43546249..98a58a46045 100644
--- a/buildtools/wafsamba/configure_file.py
+++ b/buildtools/wafsamba/configure_file.py
@@ -13,10 +13,10 @@ def subst_at_vars(task):
s = task.inputs[0].read()
# split on the vars
- a = re.split('(@\w+@)', s)
+ a = re.split(r'(@\w+@)', s)
out = []
for v in a:
- if re.match('@\w+@', v):
+ if re.match(r'@\w+@', v):
vname = v[1:-1]
if not vname in task.env and vname.upper() in task.env:
vname = vname.upper()
diff --git a/buildtools/wafsamba/pkgconfig.py b/buildtools/wafsamba/pkgconfig.py
index b83d5f382a5..b77bd618c89 100644
--- a/buildtools/wafsamba/pkgconfig.py
+++ b/buildtools/wafsamba/pkgconfig.py
@@ -9,12 +9,12 @@ def subst_at_vars(task):
s = task.inputs[0].read()
# split on the vars
- a = re.split('(@\w+@)', s)
+ a = re.split(r'(@\w+@)', s)
out = []
done_var = {}
back_sub = [ ('PREFIX', '${prefix}'), ('EXEC_PREFIX', '${exec_prefix}')]
for v in a:
- if re.match('@\w+@', v):
+ if re.match(r'@\w+@', v):
vname = v[1:-1]
if not vname in task.env and vname.upper() in task.env:
vname = vname.upper()
diff --git a/buildtools/wafsamba/samba_abi.py b/buildtools/wafsamba/samba_abi.py
index 80643aa28d7..6a8e4bcef00 100644
--- a/buildtools/wafsamba/samba_abi.py
+++ b/buildtools/wafsamba/samba_abi.py
@@ -21,16 +21,16 @@ version_key = lambda x: list(map(int, x.split(".")))
def normalise_signature(sig):
'''normalise a signature from gdb'''
sig = sig.strip()
- sig = re.sub('^\$[0-9]+\s=\s\{(.+)\}$', r'\1', sig)
- sig = re.sub('^\$[0-9]+\s=\s\{(.+)\}(\s0x[0-9a-f]+\s<\w+>)+$', r'\1', sig)
- sig = re.sub('^\$[0-9]+\s=\s(0x[0-9a-f]+)\s?(<\w+>)?$', r'\1', sig)
- sig = re.sub('0x[0-9a-f]+', '0xXXXX', sig)
+ sig = re.sub(r'^\$[0-9]+\s=\s\{(.+)\}$', r'\1', sig)
+ sig = re.sub(r'^\$[0-9]+\s=\s\{(.+)\}(\s0x[0-9a-f]+\s<\w+>)+$', r'\1', sig)
+ sig = re.sub(r'^\$[0-9]+\s=\s(0x[0-9a-f]+)\s?(<\w+>)?$', r'\1', sig)
+ sig = re.sub(r'0x[0-9a-f]+', '0xXXXX', sig)
sig = re.sub('", <incomplete sequence (\\\\[a-z0-9]+)>', r'\1"', sig)
for t in abi_type_maps:
# we need to cope with non-word characters in mapped types
m = t
- m = m.replace('*', '\*')
+ m = m.replace('*', r'\*')
if m[-1].isalnum() or m[-1] == '_':
m += '\\b'
if m[0].isalnum() or m[0] == '_':
@@ -41,7 +41,7 @@ def normalise_signature(sig):
def normalise_varargs(sig):
'''cope with older versions of gdb'''
- sig = re.sub(',\s\.\.\.', '', sig)
+ sig = re.sub(r',\s\.\.\.', '', sig)
return sig
diff --git a/buildtools/wafsamba/samba_conftests.py b/buildtools/wafsamba/samba_conftests.py
index 2c3149c0fa2..bd309adb0dd 100644
--- a/buildtools/wafsamba/samba_conftests.py
+++ b/buildtools/wafsamba/samba_conftests.py
@@ -398,7 +398,7 @@ WriteMakefile(
if section:
man = Utils.readf(os.path.join(bdir,'Makefile'))
- m = re.search('MAN%sEXT\s+=\s+(\w+)' % section, man)
+ m = re.search(r'MAN%sEXT\s+=\s+(\w+)' % section, man)
if not m:
conf.end_msg('not found', color='YELLOW')
return
diff --git a/buildtools/wafsamba/samba_headers.py b/buildtools/wafsamba/samba_headers.py
index 3313960f5f8..78f57772a82 100644
--- a/buildtools/wafsamba/samba_headers.py
+++ b/buildtools/wafsamba/samba_headers.py
@@ -19,7 +19,7 @@ def header_install_path(header, header_path):
return ''
-re_header = re.compile('^\s*#\s*include[ \t]*"([^"]+)"', re.I | re.M)
+re_header = re.compile(r'^\s*#\s*include[ \t]*"([^"]+)"', re.I | re.M)
# a dictionary mapping source header paths to public header paths
header_map = {}
diff --git a/buildtools/wafsamba/samba_utils.py b/buildtools/wafsamba/samba_utils.py
index 45047e18ada..a7ba2ac4d0d 100644
--- a/buildtools/wafsamba/samba_utils.py
+++ b/buildtools/wafsamba/samba_utils.py
@@ -237,10 +237,10 @@ def TO_LIST(str, delimiter=None):
def subst_vars_error(string, env):
'''substitute vars, throw an error if a variable is not defined'''
- lst = re.split('(\$\{\w+\})', string)
+ lst = re.split(r'(\$\{\w+\})', string)
out = []
for v in lst:
- if re.match('\$\{\w+\}', v):
+ if re.match(r'\$\{\w+\}', v):
vname = v[2:-1]
if not vname in env:
raise KeyError("Failed to find variable %s in %s in env %s <%s>" % (vname, string, env.__class__, str(env)))
diff --git a/buildtools/wafsamba/symbols.py b/buildtools/wafsamba/symbols.py
index a6af1ac1485..5fbc0723927 100644
--- a/buildtools/wafsamba/symbols.py
+++ b/buildtools/wafsamba/symbols.py
@@ -119,9 +119,9 @@ def find_ldd_path(bld, libname, binary):
# some regular expressions for parsing readelf output
-re_sharedlib = re.compile(b'Shared library: \[(.*)\]')
+re_sharedlib = re.compile(rb'Shared library: \[(.*)\]')
# output from readelf could be `Library rpath` or `Libray runpath`
-re_rpath = re.compile(b'Library (rpath|runpath): \[(.*)\]')
+re_rpath = re.compile(rb'Library (rpath|runpath): \[(.*)\]')
def get_libs(bld, binname):
'''find the list of linked libraries for any binary or library