summaryrefslogtreecommitdiffstats
path: root/testing/mozbase/mozprofile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 15:12:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-08 15:12:12 +0000
commita7c14e2f29831f4bc5eb18e23e55eb6f7a4e3431 (patch)
tree54617b4f5f04ee87a2c9e3b97cc88b8626859124 /testing/mozbase/mozprofile
parentReleasing progress-linux version 115.7.0esr-1~deb12u1progress7u1. (diff)
downloadfirefox-esr-a7c14e2f29831f4bc5eb18e23e55eb6f7a4e3431.tar.xz
firefox-esr-a7c14e2f29831f4bc5eb18e23e55eb6f7a4e3431.zip
Merging upstream version 115.8.0esr.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/mozbase/mozprofile')
-rw-r--r--testing/mozbase/mozprofile/mozprofile/prefs.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/testing/mozbase/mozprofile/mozprofile/prefs.py b/testing/mozbase/mozprofile/mozprofile/prefs.py
index 6c3b1173c8..b84d531f23 100644
--- a/testing/mozbase/mozprofile/mozprofile/prefs.py
+++ b/testing/mozbase/mozprofile/mozprofile/prefs.py
@@ -12,7 +12,15 @@ import tokenize
import mozfile
import six
from six import StringIO, string_types
-from six.moves.configparser import SafeConfigParser as ConfigParser
+
+try:
+ from six.moves.configparser import SafeConfigParser as ConfigParser
+except ImportError: # SafeConfigParser was removed in 3.12
+ from configparser import ConfigParser
+try:
+ ConfigParser.read_file
+except AttributeError: # read_file was added in 3.2, readfp removed in 3.12
+ ConfigParser.read_file = ConfigParser.readfp
if six.PY3:
@@ -24,7 +32,7 @@ __all__ = ("PreferencesReadError", "Preferences")
class PreferencesReadError(Exception):
- """read error for prefrences files"""
+ """read error for preferences files"""
class Preferences(object):
@@ -124,7 +132,7 @@ class Preferences(object):
parser = ConfigParser()
parser.optionxform = str
- parser.readfp(mozfile.load(path))
+ parser.read_file(mozfile.load(path))
if section:
if section not in parser.sections():