From 10da089b4d4eb6f48733ac7adce1169a24164c20 Mon Sep 17 00:00:00 2001
From: Karl-Hermann Wieners <karl-hermann.wieners@mpimet.mpg.de>
Date: Tue, 18 Jul 2023 13:14:20 +0200
Subject: [PATCH] expconfig: fix handling of interpolation errors

This is a follow-up of the Python 3 port.
The `message` field is no longer supported in standard exceptions.
---
 expconfig.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/expconfig.py b/expconfig.py
index c31a27b..87ffed3 100644
--- a/expconfig.py
+++ b/expconfig.py
@@ -400,7 +400,7 @@ class ExpConfig(ConfigObj):
                 elif not isinstance(value, dict):
                     value = value.replace('$', '$$')
             except (InterpolationError, ValueError) as error:
-                raise ExpConfigError(error.message, key)
+                raise ExpConfigError(str(error), key)
             section[key] = value
 
         # Undo remaining changes from walk with eval_key
@@ -412,7 +412,7 @@ class ExpConfig(ConfigObj):
                 elif not isinstance(value, dict):
                     value = value.replace('$$', '$')
             except (InterpolationError, ValueError) as error:
-                raise ExpConfigError(error.message, key)
+                raise ExpConfigError(str(error), key)
             section[key] = value
 
         # Move version info from local config to global list
-- 
GitLab