async def _drain_writer(self, timeout: NumType = None) -> None:
        """
        Wraps writer.drain() with error handling.
        """
        if self._stream_writer is None:
            raise SMTPServerDisconnected("Client not connected")

        # Wrapping drain in a task makes mypy happy
        drain_task = asyncio.Task(self._stream_writer.drain(), loop=self._loop)
        try:
            await asyncio.wait_for(drain_task, timeout, loop=self._loop)
        except ConnectionError as exc:
            raise SMTPServerDisconnected(str(exc))
        except asyncio.TimeoutError as exc:
            raise SMTPTimeoutError(str(exc))
async def _drain_writer ( self , timeout : NumType = None ) -> None : if self . _stream_writer is None : raise SMTPServerDisconnected ( "Client not connected" ) drain_task = asyncio . Task ( self . _stream_writer . drain ( ) , loop = self . _loop ) try : await asyncio . wait_for ( drain_task , timeout , loop = self . _loop ) except ConnectionError as exc : raise SMTPServerDisconnected ( str ( exc ) ) except asyncio . TimeoutError as exc : raise SMTPTimeoutError ( str ( exc ) )
Wraps writer.drain() with error handling.