__init__.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:RemoteTree 作者: deNULL 项目源码 文件源码
def close(self):
        """Closes the connection and cleans up."""
        # Close SFTP Connection.
        if self._sftp_live:
            self._sftp.close()
            self._sftp_live = False
        # Close the SSH Transport.
        if self._transport:
            self._transport.close()
            self._transport = None
        # clean up any loggers
        if self._cnopts.log:
            # if handlers are active they hang around until the app exits
            # this closes and removes the handlers if in use at close
            import logging
            lgr = logging.getLogger("paramiko")
            if lgr:
                lgr.handlers = []
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号