From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E042C433E0 for ; Fri, 22 May 2020 13:25:05 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id D877C20679 for ; Fri, 22 May 2020 13:25:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D877C20679 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 13D0A1D9A9; Fri, 22 May 2020 15:24:28 +0200 (CEST) Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by dpdk.org (Postfix) with ESMTP id 4397D1D995 for ; Fri, 22 May 2020 15:24:23 +0200 (CEST) IronPort-SDR: 5/1v9TZ2ucbq8I+kirBDFpFNVQvQxZEarSlsA5Y/a3L5L85Gq4ZCGV/J3a7zNqEFaoS07k3o0x DMYYKrxXwUJg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2020 06:24:23 -0700 IronPort-SDR: eNUeaJkj65qnU5lPAXVzBO9GrGjIZTAYBkkK6Zn35ikgAwlD8bR8vsemFsx5JPr1Ks1Qqu8fx/ 3D1BEf8ZXsYw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,421,1583222400"; d="scan'208";a="283398019" Received: from silpixa00389033.ir.intel.com (HELO silpixa00389033.ger.corp.intel.com) ([10.237.223.171]) by orsmga002.jf.intel.com with ESMTP; 22 May 2020 06:24:22 -0700 From: Louise Kilheeney To: dev@dpdk.org Cc: Louise Kilheeney Date: Fri, 22 May 2020 14:23:16 +0100 Message-Id: <20200522132320.26373-6-louise.kilheeney@intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200522132320.26373-1-louise.kilheeney@intel.com> References: <20200522132320.26373-1-louise.kilheeney@intel.com> Subject: [dpdk-dev] [PATCH 20.08 5/9] usertools/cpu_layout: support python3 only X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Changed script to explicitly use python3 only. Signed-off-by: Louise Kilheeney --- usertools/cpu_layout.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/usertools/cpu_layout.py b/usertools/cpu_layout.py index 6f129b1db..89a48cec4 100755 --- a/usertools/cpu_layout.py +++ b/usertools/cpu_layout.py @@ -1,14 +1,9 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # SPDX-License-Identifier: BSD-3-Clause # Copyright(c) 2010-2014 Intel Corporation # Copyright(c) 2017 Cavium, Inc. All rights reserved. -from __future__ import print_function import sys -try: - xrange # Python 2 -except NameError: - xrange = range # Python 3 sockets = [] cores = [] @@ -17,7 +12,7 @@ fd = open("{}/kernel_max".format(base_path)) max_cpus = int(fd.read()) fd.close() -for cpu in xrange(max_cpus + 1): +for cpu in range(max_cpus + 1): try: fd = open("{}/cpu{}/topology/core_id".format(base_path, cpu)) except IOError: -- 2.17.1