Stop importing subprocess

This commit is contained in:
Alexei Sorokin 2017-06-09 10:42:32 +03:00
parent 91e05364f6
commit 90855d4d89
1 changed files with 5 additions and 6 deletions

View File

@ -5,7 +5,6 @@ import logging
import os
import re
import signal
import subprocess
import sys
import time
import slixmpp
@ -132,12 +131,12 @@ class Hptoad:
return reply, err
try:
proc = yield from \
asyncio.create_subprocess_exec(*cmd,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
pipe = asyncio.subprocess.PIPE
proc = yield from asyncio.create_subprocess_exec(*cmd,
stdout=pipe,
stderr=pipe)
cmd_reply, cmd_err = yield from proc.communicate()
except subprocess.CalledProcessError as e:
except OSError as e:
reply = "%s: WAT" % nick
err = "Execute: %s" % str(e)
return reply, err