From da84b6017016da070e1eb2a40f630ed689604245 Mon Sep 17 00:00:00 2001 From: Guido Günther Date: Sat, 20 Jan 2018 12:53:29 +0100 Subject: config: strip '.py' suffix from commands This makes sure we parse config sections correctly even when running out of the source tree like: PYTHONPATH=. python3 "gbp/scripts/dch.py" --- gbp/config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gbp/config.py b/gbp/config.py index d63754ea..08293d34 100644 --- a/gbp/config.py +++ b/gbp/config.py @@ -559,7 +559,7 @@ class GbpOptionParser(OptionParser): to parse @type sections: C{list} of C{str} """ - self.command = command + self.command = command[:-3] if command.endswith('.py') else command self.sections = sections self.prefix = prefix self.config = {} -- cgit v1.2.3