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):
9898
9999 Returns a list of return values of all *aws*
100100 """
101+ if not aws :
102+ return []
103+
101104 def done (t , er ):
102105 # Sub-task "t" has finished, with exception "er".
103106 nonlocal state
Original file line number Diff line number Diff line change @@ -113,6 +113,13 @@ def write(self, buf):
113113 `Stream.drain` is called. It is recommended to call `Stream.drain`
114114 immediately after calling this function.
115115 """
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 :]
116123
117124 self .out_buf += buf
118125
You can’t perform that action at this time.
0 commit comments