From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A159DA054F for ; Thu, 4 Mar 2021 04:21:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6A9B640147; Thu, 4 Mar 2021 04:21:52 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 6FB9540147 for ; Thu, 4 Mar 2021 04:21:50 +0100 (CET) IronPort-SDR: OkL+sKToueT2DXcXlkwzlusBsCGF6HPaGn0IOJpu45t9ztaFuYwYJK6M6NtbzeG66gHLmDBDic nSRjw1No7Dew== X-IronPort-AV: E=McAfee;i="6000,8403,9912"; a="174968161" X-IronPort-AV: E=Sophos;i="5.81,221,1610438400"; d="scan'208";a="174968161" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2021 19:21:48 -0800 IronPort-SDR: Ja8RSh8sjQWkgK9Vyim+6Gb1L2fHVJo/RFIu/0kFcYW8R8mNjHQ0FQvPpzvCq1qZdyMpq0dekK TxgWpoutlVEQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,221,1610438400"; d="scan'208";a="400340463" Received: from dpdk-beileix-3.sh.intel.com ([10.67.110.150]) by fmsmga008.fm.intel.com with ESMTP; 03 Mar 2021 19:21:46 -0800 From: beilei.xing@intel.com To: stable@dpdk.org Cc: yongxin.liu@windriver.com, bruce.richardson@intel.com, ferruh.yigit@intel.com, Beilei Xing Date: Thu, 4 Mar 2021 11:07:36 +0800 Message-Id: <20210304030736.69702-1-beilei.xing@intel.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH] usertools: fix Python compatibility issue X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" From: Beilei Xing For LTS release before 20.02 which should support both Python 2 and 3, when running usertools/dpdk-devbind.py with Python 2,there'll be the following error: Traceback (most recent call last): File "usertools/dpdk-devbind.py", line 755, in main() File "usertools/dpdk-devbind.py", line 743, in main check_modules() File "usertools/dpdk-devbind.py", line 198, in check_modules if module_is_loaded(mod["Name"]): File "usertools/dpdk-devbind.py", line 177, in module_is_loaded release = platform.uname().release AttributeError: 'tuple' object has no attribute 'release' The root cause is that Python 2 doesn't support platform.uname().release, which is supported by Python 3. Fixes: 1e794e710d18 ("usertools: fix binding built-in kernel driver") Cc: stable@dpdk.org Signed-off-by: Beilei Xing --- usertools/dpdk-devbind.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usertools/dpdk-devbind.py b/usertools/dpdk-devbind.py index 262a5ff3a9..44ea3dd30b 100755 --- a/usertools/dpdk-devbind.py +++ b/usertools/dpdk-devbind.py @@ -174,7 +174,7 @@ def module_is_loaded(module): loaded_modules = sysfs_mods # add built-in modules as loaded - release = platform.uname().release + release = platform.release() filename = os.path.join("/lib/modules/", release, "modules.builtin") if os.path.exists(filename): try: -- 2.26.2