diff options
Diffstat (limited to 'Lib/configparser.py')
-rw-r--r-- | Lib/configparser.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/configparser.py b/Lib/configparser.py index 3470624e63f..f5666f518f1 100644 --- a/Lib/configparser.py +++ b/Lib/configparser.py @@ -633,6 +633,11 @@ class RawConfigParser(MutableMapping): self._interpolation = self._DEFAULT_INTERPOLATION if self._interpolation is None: self._interpolation = Interpolation() + if not isinstance(self._interpolation, Interpolation): + raise TypeError( + f"interpolation= must be None or an instance of Interpolation;" + f" got an object of type {type(self._interpolation)}" + ) if converters is not _UNSET: self._converters.update(converters) if defaults: |