aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2023-03-02 17:55:52 +0100
committerGuido Günther <agx@sigxcpu.org>2023-03-02 17:55:52 +0100
commitcf5b2ad3a3716487f1247e80a38c742d0cc5b865 (patch)
tree619c9cb6b788ec5a619f654d66d9be3b1a0e6787
parentc72464b901f6e0a1710404b3ca85f785fba467fd (diff)
config: Print sensible error message on duplicate sections
Don't confuse users with a backtrace.
-rw-r--r--gbp/config.py2
1 files changed, 1 insertions, 1 deletions
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,