aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2023-09-23 16:45:09 +0200
committerGuido Günther <agx@sigxcpu.org>2023-09-23 16:45:09 +0200
commit6923df4a06cc26c09963aa85a9a632f047b17c2a (patch)
tree801c2ac37f6b7c755c62e4bdd0795e9acf2986f0
parentf6d90d55a400648cfbec8bab2ad87b0eb8eec551 (diff)
config: Catch DuplicateOption errors
Nicer than printing a stack trace
-rw-r--r--gbp/config.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/gbp/config.py b/gbp/config.py
index aa5e1889..91b852e9 100644
--- a/gbp/config.py
+++ b/gbp/config.py
@@ -600,7 +600,9 @@ class GbpOptionParser(OptionParser):
try:
self.parse_config_files()
- except (configparser.ParsingError, configparser.DuplicateSectionError) as err:
+ except (configparser.ParsingError,
+ configparser.DuplicateOptionError,
+ configparser.DuplicateSectionError) as err:
raise GbpError(str(err) + "\nSee 'man gbp.conf' for the format.")
OptionParser.__init__(self, option_class=GbpOption,