X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=src%2Fnepi%2Futil%2Fexecfuncs.py;h=70cec88c23df8584b7c00a6a3fab4f78c5e5c4df;hb=02b8bd8fed84b9fdcc0daad93cbfc3fb8560135b;hp=6b5f1a5bce3bd86b0e3b445e74fe3deee09c934e;hpb=a946090127575404760c1f35174770fc88b6da7a;p=nepi.git diff --git a/src/nepi/util/execfuncs.py b/src/nepi/util/execfuncs.py index 6b5f1a5b..70cec88c 100644 --- a/src/nepi/util/execfuncs.py +++ b/src/nepi/util/execfuncs.py @@ -3,9 +3,8 @@ # Copyright (C) 2013 INRIA # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# it under the terms of the GNU General Public License version 2 as +# published by the Free Software Foundation; # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -32,7 +31,7 @@ def lexec(command, """ if env: export = '' - for envkey, envval in env.iteritems(): + for envkey, envval in env.items(): export += '%s=%s ' % (envkey, envval) command = "%s %s" % (export, command) @@ -156,7 +155,7 @@ def lspawn(command, pidfile, (out,err), proc = lexec(cmd) if proc.wait(): - raise RuntimeError, "Failed to set up application on host %s: %s %s" % (host, out,err,) + raise RuntimeError("Failed to set up application on host %s: %s %s" % (host, out,err,)) return ((out,err), proc) @@ -180,7 +179,7 @@ def lgetpid(pidfile): if out: try: - return map(int,out.strip().split(' ',1)) + return [ int(x) for x in out.strip().split(' ', 1) ] except: # Ignore, many ways to fail that don't matter that much return None