[PATCH] python: Updates for Python 3.12

chrisj at rtems.org chrisj at rtems.org
Tue Nov 21 04:47:46 UTC 2023


From: Chris Johns <chrisj at rtems.org>

- Change SafeConfigParser to ConfigParser

- Fix escape sequences in strings

Updates #4968
---
 linkers/wscript               | 2 +-
 misc/wscript                  | 2 +-
 rtemstoolkit/configuration.py | 2 +-
 rtemstoolkit/version.py       | 2 +-
 rtemstoolkit/wscript          | 2 +-
 trace/wscript                 | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/linkers/wscript b/linkers/wscript
index 8591d60..2d2d7f0 100644
--- a/linkers/wscript
+++ b/linkers/wscript
@@ -178,4 +178,4 @@ def build(bld):
                 use = modules)
 
 def tags(ctx):
-    ctx.exec_command('etags $(find . -name \*.[sSch])', shell = True)
+    ctx.exec_command('etags $(find . -name \\*.[sSch])', shell = True)
diff --git a/misc/wscript b/misc/wscript
index 21e7f75..5775dcf 100644
--- a/misc/wscript
+++ b/misc/wscript
@@ -92,4 +92,4 @@ def build(bld):
                       'tools/config/rtems-boot.ini')
 
 def tags(ctx):
-    ctx.exec_command('etags $(find . -name \*.[sSch])', shell = True)
+    ctx.exec_command('etags $(find . -name \\*.[sSch])', shell = True)
diff --git a/rtemstoolkit/configuration.py b/rtemstoolkit/configuration.py
index 1f57de4..ba38104 100644
--- a/rtemstoolkit/configuration.py
+++ b/rtemstoolkit/configuration.py
@@ -57,7 +57,7 @@ class configuration:
         else:
             self.config = configparser.ConfigParser()
         self.ini = None
-        self.macro_filter = re.compile('\$\{[^\}]+\}')
+        self.macro_filter = re.compile(r'\$\{[^\}]+\}')
 
     def __str__(self):
         if self.ini is None:
diff --git a/rtemstoolkit/version.py b/rtemstoolkit/version.py
index 56cf97f..51188bf 100644
--- a/rtemstoolkit/version.py
+++ b/rtemstoolkit/version.py
@@ -116,7 +116,7 @@ def _load_released_version_config():
                 os.path.join('..', 'VERSION'),
                 rtems.configuration_file('rtems-version.ini')]:
         if path.exists(path.join(ver)):
-            v = configparser.SafeConfigParser()
+            v = configparser.ConfigParser()
             try:
                 v.read(path.host(ver))
             except Exception as e:
diff --git a/rtemstoolkit/wscript b/rtemstoolkit/wscript
index bd7254b..0a27853 100644
--- a/rtemstoolkit/wscript
+++ b/rtemstoolkit/wscript
@@ -168,7 +168,7 @@ def rebuild(ctx):
     waflib.Options.commands.extend(['clean', 'build'])
 
 def tags(ctx):
-    ctx.exec_command('etags $(find . -name \*.[sSch])', shell = True)
+    ctx.exec_command('etags $(find . -name \\*.[sSch])', shell = True)
 
 #
 # Libelf module.
diff --git a/trace/wscript b/trace/wscript
index a3dd5d5..0c0e4b4 100644
--- a/trace/wscript
+++ b/trace/wscript
@@ -101,4 +101,4 @@ def build(bld):
                 lib = conf['lib'])
 
 def tags(ctx):
-    ctx.exec_command('etags $(find . -name \*.[sSch])', shell = True)
+    ctx.exec_command('etags $(find . -name \\*.[sSch])', shell = True)
-- 
2.37.1



More information about the devel mailing list