From cf5b2ad3a3716487f1247e80a38c742d0cc5b865 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Thu, 2 Mar 2023 17:55:52 +0100 Subject: config: Print sensible error message on duplicate sections Don't confuse users with a backtrace. --- gbp/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gbp/config.py b/gbp/config.py index 4f9e91d3..aa5e1889 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -600,7 +600,7 @@ class GbpOptionParser(OptionParser): try: self.parse_config_files() - except configparser.ParsingError as err: + except (configparser.ParsingError, configparser.DuplicateSectionError) as err: raise GbpError(str(err) + "\nSee 'man gbp.conf' for the format.") OptionParser.__init__(self, option_class=GbpOption, -- cgit v1.2.3