Fixed deprecation warning and updated changelog
This commit is contained in:
parent
611dd3e935
commit
318046fa12
|
@ -1,6 +1,12 @@
|
|||
Changelog
|
||||
=========
|
||||
|
||||
next
|
||||
~~~~
|
||||
|
||||
- deprecated ``end`` keyword-only argument in the
|
||||
:py:meth:`grpclib.server.Stream.send_message` method on the server-side
|
||||
|
||||
0.1.0
|
||||
~~~~~
|
||||
|
||||
|
|
|
@ -45,10 +45,14 @@ class Stream(StreamIterator):
|
|||
('content-type', CONTENT_TYPE)])
|
||||
self._send_initial_metadata_done = True
|
||||
|
||||
async def send_message(self, message, *, end=False):
|
||||
if end:
|
||||
warnings.warn('"end" argument is deprecated, '
|
||||
'use "send_trailing_metadata" explicitly')
|
||||
async def send_message(self, message, **kwargs):
|
||||
if 'end' in kwargs:
|
||||
warnings.warn('"end" argument is deprecated, use '
|
||||
'"stream.send_trailing_metadata" explicitly',
|
||||
stacklevel=2)
|
||||
|
||||
end = kwargs.pop('end', False)
|
||||
assert not kwargs, kwargs
|
||||
|
||||
if not self._send_initial_metadata_done:
|
||||
await self.send_initial_metadata()
|
||||
|
|
Loading…
Reference in New Issue