From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 01D7FA3168 for ; Thu, 17 Oct 2019 09:28:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EC87D1E868; Thu, 17 Oct 2019 09:28:37 +0200 (CEST) Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 0BBF41E864 for ; Thu, 17 Oct 2019 09:28:36 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2019 00:28:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,306,1566889200"; d="scan'208";a="279786954" Received: from unknown (HELO dpdk-xiaoqimai-tester.sh.intel.com) ([10.240.179.35]) by orsmga001.jf.intel.com with ESMTP; 17 Oct 2019 00:28:34 -0700 From: Xiao Qimai To: dts@dpdk.org Cc: Xiao Qimai Date: Thu, 17 Oct 2019 03:26:44 -0400 Message-Id: <1571297204-82266-1-git-send-email-qimaix.xiao@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dts] [PATCH V1] framework/utils: add verify subclazz.__bases__ is not None or empty X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dts-bounces@dpdk.org Sender: "dts" in scapy 2.4.3, when import scapy.all import * in testsuit will cause error, subclazz.__bases__ can't be None or empty in this if sentence Signed-off-by: Xiao Qimai --- framework/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/utils.py b/framework/utils.py index 8f5a233..516dc91 100644 --- a/framework/utils.py +++ b/framework/utils.py @@ -195,7 +195,7 @@ def get_subclasses(module, clazz): Get module attribute name and attribute. """ for subclazz_name, subclazz in inspect.getmembers(module): - if hasattr(subclazz, '__bases__') and clazz in subclazz.__bases__: + if hasattr(subclazz, '__bases__') and subclazz.__bases__ and clazz in subclazz.__bases__: yield (subclazz_name, subclazz) -- 1.8.3.1