Skip to content
Snippets Groups Projects
Commit 31467e70 authored by Alexander van Amesfoort's avatar Alexander van Amesfoort
Browse files

Task #8691: ObservationStartListener: fix more wrong usages of parser.error()

parent 9f9e17a9
No related branches found
No related tags found
No related merge requests found
......@@ -251,7 +251,7 @@ def checkArgs(parser, options, leftOverArgs):
options.execPath = os.path.abspath(options.execPath) # for -d or systemd
if not os.path.isfile(options.execPath) or not os.access(options.execPath, os.X_OK):
parser.error('--exec (-x): No such executable file at %s', options.execPath)
parser.error('--exec (-x): No such executable file at ' + options.execPath)
options.msgSaveDir = os.path.abspath(options.msgSaveDir) # for -d or systemd
if options.msgSaveDir and options.msgSaveDir[-1] != os.path.sep:
......@@ -260,11 +260,11 @@ def checkArgs(parser, options, leftOverArgs):
os.makedirs(options.msgSaveDir) # exist_ok=True only since Python 3.2
except OSError as exc:
if exc.errno != os.errno.EEXIST or not os.path.isdir(options.msgSaveDir):
parser.error('--msg-save-dir (-m): Failed to create %s: %s',
exc.filename, exc.strerror)
parser.error('--msg-save-dir (-m): Failed to create %s: %s' %
(exc.filename, exc.strerror))
if leftOverArgs:
parser.error('unused command line arguments: %s' % leftOverArgs)
parser.error('unused command line arguments: ' + leftOverArgs)
def main(args):
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment