public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* Fix invalid escape sequence in build-many-glibcs.py
@ 2024-01-09 21:23 Joseph Myers
  2024-01-10 10:39 ` Florian Weimer
  2024-01-10 15:18 ` H.J. Lu
  0 siblings, 2 replies; 4+ messages in thread
From: Joseph Myers @ 2024-01-09 21:23 UTC (permalink / raw)
  To: libc-alpha

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.)

diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index 7e0b90be89..9a929a6430 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -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)

-- 
Joseph S. Myers
josmyers@redhat.com


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-01-10 15:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-09 21:23 Fix invalid escape sequence in build-many-glibcs.py Joseph Myers
2024-01-10 10:39 ` Florian Weimer
2024-01-10 15:18 ` H.J. Lu
2024-01-10 15:23   ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).