File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed
Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -70,10 +70,8 @@ async def _on_chunk_update(self, chunk: proto_DataStream.Chunk):
7070 await self ._queue .put (chunk )
7171
7272 async def _on_stream_close (self , trailer : proto_DataStream .Trailer ):
73- if self .info .attributes is None :
74- self .info .attributes = dict (trailer .attributes )
75- else :
76- self .info .attributes .update (trailer .attributes )
73+ self .info .attributes = self .info .attributes or {}
74+ self .info .attributes .update (trailer .attributes )
7775 await self ._queue .put (None )
7876
7977 def __aiter__ (self ) -> AsyncIterator [str ]:
@@ -122,10 +120,8 @@ async def _on_chunk_update(self, chunk: proto_DataStream.Chunk):
122120 await self ._queue .put (chunk )
123121
124122 async def _on_stream_close (self , trailer : proto_DataStream .Trailer ):
125- if self .info .attributes is None :
126- self .info .attributes = dict (trailer .attributes )
127- else :
128- self .info .attributes .update (trailer .attributes )
123+ self .info .attributes = self .info .attributes or {}
124+ self .info .attributes .update (trailer .attributes )
129125 await self ._queue .put (None )
130126
131127 def __aiter__ (self ) -> AsyncIterator [bytes ]:
You can’t perform that action at this time.
0 commit comments