Skip to content

Commit 0242952

Browse files
Fix #32
1 parent 93ab045 commit 0242952

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

subprocess_with_resource_limits.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ def run(command, **parameters):
2828
return output
2929

3030

31-
@asyncio.coroutine
32-
def run_coroutine(
31+
async def run_coroutine(
3332
loop,
3433
command,
3534
stdin=None,
@@ -117,7 +116,7 @@ def set_limits():
117116
stdin=stdin_stream,
118117
)
119118

120-
transport, protocol = yield from process
119+
transport, protocol = await process
121120
errors = []
122121
if max_real_seconds:
123122

@@ -142,7 +141,7 @@ def wall_clock_alarm(errors):
142141
timer.start()
143142
# Wait for the subprocess exit using the process_exited() method
144143
# of the protocol
145-
yield from exit_future
144+
await exit_future
146145
if max_real_seconds:
147146
timer.cancel()
148147
transport.close()

0 commit comments

Comments
 (0)