原因:
原因是init中self定义顺序的问题
如下为正确:
class EchoHandler(BaseRequestHandler):
def __init__(self, request, client_address, server):
self.db = Database("localhost", "root", "root", "FANUC")
super().__init__(request, client_address, server)
如下为错误:
class EchoHandler(BaseRequestHandler):
def __init__(self, request, client_address, server):
super().__init__(request, client_address, server)
self.db = Database("localhost", "root", "root", "FANUC")