mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-21 18:38:08 +01:00
python: adjust legacy bindings to py 3.12
Py 3.12 finally pulled the plug on the `SafeConfigParser` class which has been deprecated since py 3.2. We use it in the legacy bindings only, so take the easy route of importing `ConfigParser` as `SafeConfigParser` and monkey-patching so that the class has the expected interface.
This commit is contained in:
parent
95a4bf3817
commit
3771832b01
1 changed files with 4 additions and 1 deletions
|
@ -47,7 +47,10 @@ if sys.version_info[0] == 2:
|
|||
|
||||
return value
|
||||
else:
|
||||
from configparser import SafeConfigParser
|
||||
from configparser import ConfigParser as SafeConfigParser
|
||||
|
||||
if not hasattr(SafeConfigParser, 'readfp'): # py >= 3.12
|
||||
SafeConfigParser.readfp = SafeConfigParser.read_file
|
||||
|
||||
class Python3StringMixIn(object):
|
||||
def __str__(self):
|
||||
|
|
Loading…
Reference in a new issue