summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2022-05-15 20:09:04 -0500
committerMichael Merickel <michael@merickel.org>2022-05-15 20:09:04 -0500
commitc6a3122b374d9ec3e9f06beefcd31a0c8136f7f1 (patch)
tree42802e9e35178d70af36f03b90a0da9ea0e6e618
parentc666acbfa11257abed3395e433d5d0af8a35e260 (diff)
downloadpastedeploy-git-c6a3122b374d9ec3e9f06beefcd31a0c8136f7f1.tar.gz
remove py2 configparser shims
-rw-r--r--paste/deploy/loadwsgi.py19
1 files changed, 1 insertions, 18 deletions
diff --git a/paste/deploy/loadwsgi.py b/paste/deploy/loadwsgi.py
index 78c5956..c5471e5 100644
--- a/paste/deploy/loadwsgi.py
+++ b/paste/deploy/loadwsgi.py
@@ -58,10 +58,7 @@ class NicerConfigParser(ConfigParser):
def __init__(self, filename, *args, **kw):
ConfigParser.__init__(self, *args, **kw)
self.filename = filename
- if hasattr(self, '_interpolation'):
- self._interpolation = self.InterpolateWrapper(self._interpolation)
-
- read_file = getattr(ConfigParser, 'read_file', ConfigParser.readfp)
+ self._interpolation = self.InterpolateWrapper(self._interpolation)
def defaults(self):
"""Return the defaults, with their values interpolated (with the
@@ -74,21 +71,7 @@ class NicerConfigParser(ConfigParser):
defaults[key] = self.get('DEFAULT', key) or val
return defaults
- def _interpolate(self, section, option, rawval, vars):
- # Python < 3.2
- try:
- return ConfigParser._interpolate(
- self, section, option, rawval, vars)
- except Exception:
- e = sys.exc_info()[1]
- args = list(e.args)
- args[0] = f'Error in file {self.filename}: {e}'
- e.args = tuple(args)
- e.message = args[0]
- raise
-
class InterpolateWrapper:
- # Python >= 3.2
def __init__(self, original):
self._original = original