[Treepkg-commits] r302 - trunk/treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Mon Apr 26 12:22:57 CEST 2010


Author: bricks
Date: 2010-04-26 12:22:55 +0200 (Mon, 26 Apr 2010)
New Revision: 302

Modified:
   trunk/treepkg/run.py
Log:
fixed last commit
try except block must include Popen(...)


Modified: trunk/treepkg/run.py
===================================================================
--- trunk/treepkg/run.py	2010-04-26 10:12:35 UTC (rev 301)
+++ trunk/treepkg/run.py	2010-04-26 10:22:55 UTC (rev 302)
@@ -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)
 



More information about the Treepkg-commits mailing list