python类EBADF的实例源码

rocket.py 文件源码 项目:touch-pay-client 作者: HackPucBemobi 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def close(self):
        if hasattr(self.socket, '_sock'):
            try:
                self.socket._sock.close()
            except socket.error:
                info = sys.exc_info()
                if info[1].args[0] != socket.EBADF:
                    raise info[1]
                else:
                    pass
        self.socket.close()

# Monolithic build...end of module: rocket/connection.py
# Monolithic build...start of module: rocket/filelike.py

# Import System Modules
rocket.py 文件源码 项目:true_review_web2py 作者: lucadealfaro 项目源码 文件源码 阅读 36 收藏 0 点赞 0 评论 0
def close(self):
        if hasattr(self.socket, '_sock'):
            try:
                self.socket._sock.close()
            except socket.error:
                info = sys.exc_info()
                if info[1].args[0] != socket.EBADF:
                    raise info[1]
                else:
                    pass
        self.socket.close()

# Monolithic build...end of module: rocket/connection.py
# Monolithic build...start of module: rocket/filelike.py

# Import System Modules
rocket.py 文件源码 项目:yt 作者: yt-project 项目源码 文件源码 阅读 29 收藏 0 点赞 0 评论 0
def close(self):
        if hasattr(self.socket, '_sock'):
            try:
                self.socket._sock.close()
            except socket.error:
                info = sys.exc_info()
                if info[1].args[0] != socket.EBADF:
                    raise info[1]
                else:
                    pass
        self.socket.close()


# Monolithic build...end of module: rocket/connection.py
# Monolithic build...start of module: rocket/filelike.py

# Import System Modules
rocket.py 文件源码 项目:yt 作者: yt-project 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def send_response(self, status):
        stat_msg = status.split(' ', 1)[1]
        msg = RESPONSE % (status,
                          len(stat_msg),
                          'text/plain',
                          stat_msg)
        try:
            self.conn.sendall(b(msg))
        except socket.error:
            self.closeConnection = True
            self.err_log.error('Tried to send "%s" to client but received socket'
                           ' error' % status)

    #def kill(self):
    #    if self.isAlive() and hasattr(self, 'conn'):
    #        try:
    #            self.conn.shutdown(socket.SHUT_RDWR)
    #        except socket.error:
    #            info = sys.exc_info()
    #            if info[1].args[0] != socket.EBADF:
    #                self.err_log.debug('Error on shutdown: '+str(info))
rocket.py 文件源码 项目:Problematica-public 作者: TechMaz 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def close(self):
        if hasattr(self.socket, '_sock'):
            try:
                self.socket._sock.close()
            except socket.error:
                info = sys.exc_info()
                if info[1].args[0] != socket.EBADF:
                    raise info[1]
                else:
                    pass
        self.socket.close()

# Monolithic build...end of module: rocket/connection.py
# Monolithic build...start of module: rocket/filelike.py

# Import System Modules
rocket.py 文件源码 项目:rekall-agent-server 作者: rekall-innovations 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def close(self):
        if hasattr(self.socket, '_sock'):
            try:
                self.socket._sock.close()
            except socket.error:
                info = sys.exc_info()
                if info[1].args[0] != socket.EBADF:
                    raise info[1]
                else:
                    pass
        self.socket.close()

# Monolithic build...end of module: rocket/connection.py
# Monolithic build...start of module: rocket/filelike.py

# Import System Modules
rocket.py 文件源码 项目:web3py 作者: web2py 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def close(self):
        if hasattr(self.socket, '_sock'):
            try:
                self.socket._sock.close()
            except socket.error:
                info = sys.exc_info()
                if info[1].args[0] != socket.EBADF:
                    raise info[1]
                else:
                    pass
        self.socket.close()

# Monolithic build...end of module: rocket/connection.py
# Monolithic build...start of module: rocket/filelike.py

# Import System Modules
rocket.py 文件源码 项目:CSC376KnowledgeManagement 作者: WCotterman 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def close(self):
        if hasattr(self.socket, '_sock'):
            try:
                self.socket._sock.close()
            except socket.error:
                info = sys.exc_info()
                if info[1].args[0] != socket.EBADF:
                    raise info[1]
                else:
                    pass
        self.socket.close()

# Monolithic build...end of module: rocket/connection.py
# Monolithic build...start of module: rocket/filelike.py

# Import System Modules
rocket.py 文件源码 项目:slugiot-client 作者: slugiot 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def close(self):
        if hasattr(self.socket, '_sock'):
            try:
                self.socket._sock.close()
            except socket.error:
                info = sys.exc_info()
                if info[1].args[0] != socket.EBADF:
                    raise info[1]
                else:
                    pass
        self.socket.close()

# Monolithic build...end of module: rocket/connection.py
# Monolithic build...start of module: rocket/filelike.py

# Import System Modules
rocket.py 文件源码 项目:StuffShare 作者: StuffShare 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def close(self):
        if hasattr(self.socket, '_sock'):
            try:
                self.socket._sock.close()
            except socket.error:
                info = sys.exc_info()
                if info[1].args[0] != socket.EBADF:
                    raise info[1]
                else:
                    pass
        self.socket.close()

# Monolithic build...end of module: rocket/connection.py
# Monolithic build...start of module: rocket/filelike.py

# Import System Modules
zeroconf.py 文件源码 项目:libpurecoollink 作者: CharlesBlonde 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def run(self):
        while not self.zc.done:
            with self.condition:
                rs = self.readers.keys()
                if len(rs) == 0:
                    # No sockets to manage, but we wait for the timeout
                    # or addition of a socket
                    self.condition.wait(self.timeout)

            if len(rs) != 0:
                try:
                    rr, wr, er = select.select(rs, [], [], self.timeout)
                    if not self.zc.done:
                        for socket_ in rr:
                            reader = self.readers.get(socket_)
                            if reader:
                                reader.handle_read(socket_)

                except (select.error, socket.error) as e:
                    # If the socket was closed by another thread, during
                    # shutdown, ignore it and exit
                    if e.args[0] != socket.EBADF or not self.zc.done:
                        raise


问题


面经


文章

微信
公众号

扫码关注公众号