Mercurial > treepkg
changeset 347:2910051b91f7
fixed last commit
try except block must include Popen(...)
author | Bjoern Ricks <bricks@intevation.de> |
---|---|
date | Mon, 26 Apr 2010 10:22:55 +0000 |
parents | 9cb4ed04434f |
children | bcd01f68662c |
files | treepkg/run.py |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/treepkg/run.py Mon Apr 26 10:12:35 2010 +0000 +++ b/treepkg/run.py Mon Apr 26 10:22:55 2010 +0000 @@ -41,15 +41,15 @@ if env is None: env = os.environ.copy() env.update(extra_env) + try: + process = subprocess.Popen(command, env=env, **kw) + except OSError,e: + raise SubprocessError(command, e.errno, e.strerror) - process = subprocess.Popen(command, env=env, **kw) if inputdata is not None: process.stdin.write(inputdata) process.stdin.close() - try: - ret = process.wait() - except OSError,e: - raise SubprocessError(command, e.errno, e.strerror) + ret = process.wait() if ret != 0: raise SubprocessError(command, ret)