File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -98,6 +98,9 @@ async def gather(*aws, return_exceptions=False):
98
98
99
99
Returns a list of return values of all *aws*
100
100
"""
101
+ if not aws :
102
+ return []
103
+
101
104
def done (t , er ):
102
105
# Sub-task "t" has finished, with exception "er".
103
106
nonlocal state
Original file line number Diff line number Diff line change @@ -113,6 +113,13 @@ def write(self, buf):
113
113
`Stream.drain` is called. It is recommended to call `Stream.drain`
114
114
immediately after calling this function.
115
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 :]
116
123
117
124
self .out_buf += buf
118
125
You can’t perform that action at this time.
0 commit comments