summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMaxim Cournoyer <maxim.cournoyer@gmail.com>2022-12-20 08:38:37 +0300
committerSimon Glass <sjg@chromium.org>2023-01-06 05:21:57 +0300
commit8b73f9bf9e979b47aa4f7dcbd6727945a0da02f8 (patch)
tree178fd940ec20c837fbef3739c51a62e5cd4f91d1 /tools
parent872f3a4ce245e9573a9572971074a8e57c1f6022 (diff)
downloadu-boot-8b73f9bf9e979b47aa4f7dcbd6727945a0da02f8.tar.xz
patman: replace deprecated SafeConfigParser with ConfigParser
The SafeConfigParser class has been renamed in Python 3.2 to ConfigParser, and the old alias has been deprecated since. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'tools')
-rw-r--r--tools/patman/settings.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/tools/patman/settings.py b/tools/patman/settings.py
index b6884a073e..7fb9d6d5a0 100644
--- a/tools/patman/settings.py
+++ b/tools/patman/settings.py
@@ -30,7 +30,7 @@ _default_settings = {
}
-class _ProjectConfigParser(ConfigParser.SafeConfigParser):
+class _ProjectConfigParser(ConfigParser.ConfigParser):
"""ConfigParser that handles projects.
There are two main goals of this class:
@@ -81,14 +81,14 @@ class _ProjectConfigParser(ConfigParser.SafeConfigParser):
def __init__(self, project_name):
"""Construct _ProjectConfigParser.
- In addition to standard SafeConfigParser initialization, this
- also loads project defaults.
+ In addition to standard ConfigParser initialization, this also
+ loads project defaults.
Args:
project_name: The name of the project.
"""
self._project_name = project_name
- ConfigParser.SafeConfigParser.__init__(self)
+ ConfigParser.ConfigParser.__init__(self)
# Update the project settings in the config based on
# the _default_settings global.
@@ -100,31 +100,31 @@ class _ProjectConfigParser(ConfigParser.SafeConfigParser):
self.set(project_settings, setting_name, setting_value)
def get(self, section, option, *args, **kwargs):
- """Extend SafeConfigParser to try project_section before section.
+ """Extend ConfigParser to try project_section before section.
Args:
- See SafeConfigParser.
+ See ConfigParser.
Returns:
- See SafeConfigParser.
+ See ConfigParser.
"""
try:
- val = ConfigParser.SafeConfigParser.get(
+ val = ConfigParser.ConfigParser.get(
self, "%s_%s" % (self._project_name, section), option,
*args, **kwargs
)
except (ConfigParser.NoSectionError, ConfigParser.NoOptionError):
- val = ConfigParser.SafeConfigParser.get(
+ val = ConfigParser.ConfigParser.get(
self, section, option, *args, **kwargs
)
return val
def items(self, section, *args, **kwargs):
- """Extend SafeConfigParser to add project_section to section.
+ """Extend ConfigParser to add project_section to section.
Args:
- See SafeConfigParser.
+ See ConfigParser.
Returns:
- See SafeConfigParser.
+ See ConfigParser.
"""
project_items = []
has_project_section = False
@@ -132,7 +132,7 @@ class _ProjectConfigParser(ConfigParser.SafeConfigParser):
# Get items from the project section
try:
- project_items = ConfigParser.SafeConfigParser.items(
+ project_items = ConfigParser.ConfigParser.items(
self, "%s_%s" % (self._project_name, section), *args, **kwargs
)
has_project_section = True
@@ -141,7 +141,7 @@ class _ProjectConfigParser(ConfigParser.SafeConfigParser):
# Get top-level items
try:
- top_items = ConfigParser.SafeConfigParser.items(
+ top_items = ConfigParser.ConfigParser.items(
self, section, *args, **kwargs
)
except ConfigParser.NoSectionError: