fix for reactor.spawnProcess sending deprecation warning

This commit is contained in:
Vishvananda Ishaya
2010-06-11 11:13:23 -07:00
parent ac4e6dfbcb
commit 733e898d60

View File

@@ -151,6 +151,11 @@ def getProcessOutput(executable, args=None, env=None, path=None, reactor=None,
d = defer.Deferred()
p = BackRelayWithInput(
d, startedDeferred=startedDeferred, error_ok=error_ok, input=input)
# VISH: commands come in as unicode, but self.executes needs
# strings or process.spawn raises a deprecation warning
executable = str(executable)
if not args is None:
args = [str(x) for x in args]
reactor.spawnProcess(p, executable, (executable,)+tuple(args), env, path)
return d