Stop importing subprocess
This commit is contained in:
parent
91e05364f6
commit
90855d4d89
11
hptoad.py
11
hptoad.py
|
@ -5,7 +5,6 @@ import logging
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import signal
|
import signal
|
||||||
import subprocess
|
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import slixmpp
|
import slixmpp
|
||||||
|
@ -132,12 +131,12 @@ class Hptoad:
|
||||||
return reply, err
|
return reply, err
|
||||||
|
|
||||||
try:
|
try:
|
||||||
proc = yield from \
|
pipe = asyncio.subprocess.PIPE
|
||||||
asyncio.create_subprocess_exec(*cmd,
|
proc = yield from asyncio.create_subprocess_exec(*cmd,
|
||||||
stdout=subprocess.PIPE,
|
stdout=pipe,
|
||||||
stderr=subprocess.PIPE)
|
stderr=pipe)
|
||||||
cmd_reply, cmd_err = yield from proc.communicate()
|
cmd_reply, cmd_err = yield from proc.communicate()
|
||||||
except subprocess.CalledProcessError as e:
|
except OSError as e:
|
||||||
reply = "%s: WAT" % nick
|
reply = "%s: WAT" % nick
|
||||||
err = "Execute: %s" % str(e)
|
err = "Execute: %s" % str(e)
|
||||||
return reply, err
|
return reply, err
|
||||||
|
|
Loading…
Reference in New Issue