]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix invalid escape sequence in build-many-glibcs.py
authorJoseph Myers <josmyers@redhat.com>
Wed, 10 Jan 2024 13:01:39 +0000 (13:01 +0000)
committerJoseph Myers <josmyers@redhat.com>
Wed, 10 Jan 2024 13:01:39 +0000 (13:01 +0000)
Running build-many-glibcs.py with Python 3.12 or later produces a
warning:

build-many-glibcs.py:173: SyntaxWarning: invalid escape sequence '\.'
  m = re.fullmatch('([0-9]+)\.([0-9]+)[.0-9]*', l)

Use a raw string instead to avoid that warning.  (Note: I haven't
checked whether any other Python scripts included with glibc might
have issues with newer Python versions.)

scripts/build-many-glibcs.py

index 7e0b90be8984fc5f040012949f6791f54aa5fcf0..9a929a6430dc9e213c74fbaff15b67423c489648 100755 (executable)
@@ -170,7 +170,7 @@ class Context(object):
             if l.startswith(starttext):
                 l = l[len(starttext):]
                 l = l.rstrip('"\n')
-                m = re.fullmatch('([0-9]+)\.([0-9]+)[.0-9]*', l)
+                m = re.fullmatch(r'([0-9]+)\.([0-9]+)[.0-9]*', l)
                 return '%s.%s' % m.group(1, 2)
         print('error: could not determine glibc version')
         exit(1)