We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 723b428 + 84c73c6 commit c277db5Copy full SHA for c277db5
asyncio/funcs.py
@@ -98,6 +98,9 @@ async def gather(*aws, return_exceptions=False):
98
99
Returns a list of return values of all *aws*
100
"""
101
+ if not aws:
102
+ return []
103
+
104
def done(t, er):
105
# Sub-task "t" has finished, with exception "er".
106
nonlocal state
asyncio/stream.py
@@ -113,6 +113,13 @@ def write(self, buf):
113
`Stream.drain` is called. It is recommended to call `Stream.drain`
114
immediately after calling this function.
115
116
+ if not self.out_buf:
117
+ # Try to write immediately to the underlying stream.
118
+ ret = self.s.write(buf)
119
+ if ret == len(buf):
120
+ return
121
+ if ret is not None:
122
+ buf = buf[ret:]
123
124
self.out_buf += buf
125
0 commit comments