def sendLine(self, line):
        """
        Sends a line, unless line is None.

        @param line: Line to send
        @type line: L{bytes} or L{unicode}
        """
        if line is None:
            return
        elif isinstance(line, unicode):
            line = line.encode(self._encoding)
        basic.LineReceiver.sendLine(self, line)

        Sends a line, unless line is None.

        @param line: Line to send
        @type line: L{bytes} or L{unicode}
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/protocols/ftp.py