diff --git a/bin/parseConfigFile.py b/bin/parseConfigFile.py
-index 20d782c8c..adf1809c8 100644
+index 20d782c8c..9be59649f 100644
--- a/bin/parseConfigFile.py
+++ b/bin/parseConfigFile.py
@@ -17,8 +17,13 @@
+import sys
+import configparser
+if sys.version_info[:2] >= (3,12):
-+ import configparser.ConfigParser as SafeConfigParser
++ from configparser import ConfigParser as SafeConfigParser
+else:
-+ import configparser.SafeConfigParser
++ from configparser import SafeConfigParser
import logging
import re
from io import StringIO
# copied from python 2.6.8 Lib.ConfigParser.py
# modified (see code comments) to handle duplicate keys
diff --git a/bin/salomeContext.py b/bin/salomeContext.py
-index 04f960e31..fa95889c5 100755
+index 04f960e31..273e4ef66 100755
--- a/bin/salomeContext.py
+++ b/bin/salomeContext.py
-@@ -22,6 +22,10 @@ import os
+@@ -22,7 +22,10 @@ import os
import sys
import logging
import configparser
+-
+if sys.version_info[:2] >= (3,12):
-+ import configparser.ConfigParser as SafeConfigParser
++ from configparser import ConfigParser as SafeConfigParser
+else:
-+ import configparser.SafeConfigParser
-
++ from configparser import SafeConfigParser
from parseConfigFile import parseConfigFile
-@@ -542,7 +546,7 @@ class SalomeContext:
+ import tempfile
+@@ -542,7 +545,7 @@ class SalomeContext:
#
def _showSoftwareVersions(self, softwares=None):