Skip to content

Commit ca9e6f0

Browse files
committed
Merge pull request #61 from AlecAivazis/master
Added check for futures in asyncio executor
2 parents 0fa590d + 774a2b9 commit ca9e6f0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

graphql/execution/executors/asyncio.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ def __init__(self):
1010
self.futures = []
1111

1212
def wait_until_finished(self):
13-
self.loop.run_until_complete(wait(self.futures))
13+
# if there are futures to wait for
14+
if self.futures:
15+
# wait for the futures to finish
16+
self.loop.run_until_complete(wait(self.futures))
1417

1518
def execute(self, fn, *args, **kwargs):
1619
result = fn(*args, **kwargs)

0 commit comments

Comments
 (0)