]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tools: binman: fix deprecated Python ConfigParser methods
authorBrandon Maier <brandon.maier@collins.com>
Tue, 4 Jun 2024 16:16:06 +0000 (16:16 +0000)
committerSimon Glass <sjg@chromium.org>
Wed, 3 Jul 2024 06:36:33 +0000 (07:36 +0100)
The method `ConfigParser.readfp()` is marked deprecated[1].

In Python 3.12 this method have been removed, so replace it with
`ConfigParser.read_file()`.

[1] https://docs.python.org/3.11/library/configparser.html#configparser.ConfigParser.readfp

Signed-off-by: Brandon Maier <brandon.maier@collins.com>
CC: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
tools/buildman/bsettings.py

index e225ac2ca0f4f6285fb037c5dd084ca8470684ce..aea724fc559fa500205fc12a90145c9b97567fc3 100644 (file)
@@ -29,7 +29,7 @@ def setup(fname=''):
             settings.read(config_fname)
 
 def add_file(data):
-    settings.readfp(io.StringIO(data))
+    settings.read_file(io.StringIO(data))
 
 def get_items(section):
     """Get the items from a section of the config.