mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-11-06 03:12:04 +01:00
51 lines
1.6 KiB
Diff
51 lines
1.6 KiB
Diff
deprecated in python 3.2
|
|
|
|
diff --git a/offlineimap/CustomConfig.py b/offlineimap/CustomConfig.py
|
|
index 59da078..758b936 100644
|
|
--- a/offlineimap/CustomConfig.py
|
|
+++ b/offlineimap/CustomConfig.py
|
|
@@ -17,13 +17,13 @@
|
|
import os
|
|
import re
|
|
from sys import exc_info
|
|
-from configparser import SafeConfigParser, Error
|
|
+from configparser import ConfigParser, Error
|
|
from offlineimap.localeval import LocalEval
|
|
|
|
|
|
-class CustomConfigParser(SafeConfigParser):
|
|
+class CustomConfigParser(ConfigParser):
|
|
def __init__(self):
|
|
- SafeConfigParser.__init__(self)
|
|
+ ConfigParser.__init__(self)
|
|
self.localeval = None
|
|
|
|
def getdefault(self, section, option, default, *args, **kwargs):
|
|
diff --git a/offlineimap/localeval.py b/offlineimap/localeval.py
|
|
index 9168666..155f779 100644
|
|
--- a/offlineimap/localeval.py
|
|
+++ b/offlineimap/localeval.py
|
|
@@ -18,4 +18,3 @@
|
|
|
|
-import imp
|
|
-
|
|
+import importlib
|
|
|
|
@@ -28,12 +27,10 @@ class LocalEval:
|
|
if path is not None:
|
|
# FIXME: limit opening files owned by current user with rights set
|
|
# to fixed mode 644.
|
|
- foo = open(path, 'r')
|
|
- module = imp.load_module(
|
|
- '<none>',
|
|
- foo,
|
|
- path,
|
|
- ('', 'r', imp.PY_SOURCE))
|
|
+ importlib.machinery.SOURCE_SUFFIXES.append('') # empty string to allow any file
|
|
+ spec = importlib.util.spec_from_file_location('<none>', path)
|
|
+ module = importlib.util.module_from_spec(spec)
|
|
+ spec.loader.exec_module(module)
|
|
for attr in dir(module):
|
|
self.namespace[attr] = getattr(module, attr)
|
|
|