Skip to content

Commit b05a07a

Browse files
committed
Python 3.12 config parser changes
Changes: - ConfigParser readfp is no more in python 3.12 made changes to replace with read_file Tested: - Ran from sandbox with changes with levels Robot Framework 7.1.1 (Python 3.10.12 on linux) Robot Framework 7.1.1 (Python 3.12.9 on linux) Change-Id: I9e29fdc84f27c004896cffb77cfde0ec786afa6c Signed-off-by: George Keishing <[email protected]>
1 parent 73af927 commit b05a07a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/gen_misc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,13 @@ def my_parm_file(prop_file_path):
306306

307307
# Create the ConfigParser object.
308308
try:
309-
config_parser = ConfigParser.ConfigParser()
309+
config_parser = ConfigParser()
310310
except NameError:
311311
config_parser = configparser.ConfigParser(strict=False)
312312
# Make the property names case-sensitive.
313313
config_parser.optionxform = str
314314
# Read the properties from the string file.
315-
config_parser.readfp(string_file)
315+
config_parser.read_file(string_file)
316316
# Return the properties as a dictionary.
317317
if robot_env:
318318
return DotDict(config_parser.items("dummysection"))

0 commit comments

Comments
 (0)