Closes #11324: ConfigParser(interpolation=None) doesn't work.
Initial patches by Tobias Brink. Thanks!
diff --git a/Lib/configparser.py b/Lib/configparser.py
index 0ecff70..82b6f03 100644
--- a/Lib/configparser.py
+++ b/Lib/configparser.py
@@ -623,11 +623,12 @@
self._strict = strict
self._allow_no_value = allow_no_value
self._empty_lines_in_values = empty_lines_in_values
- if interpolation is _UNSET:
- self._interpolation = self._DEFAULT_INTERPOLATION
- else:
- self._interpolation = interpolation
self.default_section=default_section
+ self._interpolation = interpolation
+ if self._interpolation is _UNSET:
+ self._interpolation = self._DEFAULT_INTERPOLATION
+ if self._interpolation is None:
+ self._interpolation = Interpolation()
def defaults(self):
return self._defaults