From f4c8e20ef69e733a536b570c353dc0b20a3c72e0 Mon Sep 17 00:00:00 2001 From: ced <> Date: Thu, 6 Sep 2007 14:12:35 +0000 Subject: [PATCH] Add exception to exec_pg_command... bzr revid: ced-de6c319e4e2cf61187887e314784c2263e173975 --- bin/tools/misc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bin/tools/misc.py b/bin/tools/misc.py index 6c52a9dbfc6..c28a56f2d10 100644 --- a/bin/tools/misc.py +++ b/bin/tools/misc.py @@ -140,11 +140,15 @@ def find_pg_tool(name): def exec_pg_command(name, *args): prog = find_pg_tool(name) + if not prog: + raise Exception('Couldn\'t find %s' % name) args2 = (os.path.basename(prog),) + args return os.spawnv(os.P_WAIT, prog, args2) def exec_pg_command_pipe(name, *args): prog = find_pg_tool(name) + if not prog: + raise Exception('Couldn\'t find %s' % name) if os.name == "nt": cmd = '"' + prog + '" ' + ' '.join(args) else: @@ -154,7 +158,7 @@ def exec_pg_command_pipe(name, *args): def exec_command_pipe(name, *args): prog = find_in_path(name) if not prog: - raise + raise Exception('Couldn\'t find %s' % name) if os.name == "nt": cmd = '"'+prog+'" '+' '.join(args) else: