[PATCH v2] sb: Fix Python 3.12 safeConfigParser and invalid escape sequences

chrisj at rtems.org chrisj at rtems.org
Tue Nov 21 04:34:07 UTC 2023


From: Chris Johns <chrisj at rtems.org>

Updates #4968
---
 source-builder/sb/pkgconfig.py | 4 ++--
 source-builder/sb/version.py   | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/source-builder/sb/pkgconfig.py b/source-builder/sb/pkgconfig.py
index 198ec80..bfe769f 100755
--- a/source-builder/sb/pkgconfig.py
+++ b/source-builder/sb/pkgconfig.py
@@ -90,7 +90,7 @@ class package(object):
     get_recursion = ['cflags', 'libs']
     no_dup_flags = ['-I', '-l', '-L']
     dual_opts = ['-D', '-U', '-I', '-l', '-L']
-    lib_list_splitter = re.compile('[\s,]+')
+    lib_list_splitter = re.compile(r'[\s,]+')
     loaded_prefixes = None
     loaded = {}
 
@@ -514,7 +514,7 @@ class package(object):
             return None
         s = ''
         if self.file_:
-            mre = re.compile('\$\{[^\}]+\}')
+            mre = re.compile(r'\$\{[^\}]+\}')
             s = self.fields[label.lower()]
             expanded = True
             tm = False
diff --git a/source-builder/sb/version.py b/source-builder/sb/version.py
index 4ec7cfa..eb6a17d 100644
--- a/source-builder/sb/version.py
+++ b/source-builder/sb/version.py
@@ -110,7 +110,7 @@ def _load_released_version_config():
                 import configparser
             except ImportError:
                 import ConfigParser as configparser
-            v = configparser.SafeConfigParser()
+            v = configparser.ConfigParser()
             try:
                 v.read(path.host(ver))
             except Exception as e:
-- 
2.37.1



More information about the devel mailing list