From 105a0abf32b287e04e2809abcc840a1e169ae5b0 Mon Sep 17 00:00:00 2001 From: hanhxiao Date: Fri, 6 Sep 2019 15:54:05 +0800 Subject: [PATCH] feat(encoder): add debug hook --- gnes/service/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnes/service/base.py b/gnes/service/base.py index 3d456067..1371ae32 100644 --- a/gnes/service/base.py +++ b/gnes/service/base.py @@ -398,8 +398,8 @@ def _run(self, ctx): # choose output sock if msg.request and msg.request.WhichOneof('body') and \ - type(getattr(msg.request, - msg.request.WhichOneof('body'))) == gnes_pb2.Request.ControlRequest: + isinstance(getattr(msg.request, msg.request.WhichOneof('body')), + gnes_pb2.Request.ControlRequest): o_sock = ctrl_sock else: o_sock = out_sock