aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2018-01-20 12:53:29 +0100
committerGuido Günther <agx@sigxcpu.org>2018-01-20 12:53:29 +0100
commitda84b6017016da070e1eb2a40f630ed689604245 (patch)
tree8387faab0bc1e8a47912309de3aa7f82cf859f17
parentc3e1beba64b30f2db9c08bc47d291fac4a028ae1 (diff)
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"
-rw-r--r--gbp/config.py2
1 files changed, 1 insertions, 1 deletions
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 = {}