Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3927849imm; Mon, 8 Oct 2018 11:49:59 -0700 (PDT) X-Google-Smtp-Source: ACcGV63f+Xeimy7FHAZfYFXuUqRU8HDXrWhARmefiysr02sHtF4LvW2AWUoqTfmDKQMJmY9kT5Am X-Received: by 2002:a62:8dcd:: with SMTP id p74-v6mr27031837pfk.217.1539024599424; Mon, 08 Oct 2018 11:49:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539024599; cv=none; d=google.com; s=arc-20160816; b=uBbtJabKwSam9vsJPlLtv9ZWQ+2annoo0pCK60CHZjIrCEK3jaCUolmMN/oQyCQsgI orm0OBmTcIMqPjV9rrshSlTUceEMDNC84wQeqN2/yRyq5nB3urJWwfDB+dmQ4RMA8UIm hSpRRYAsjdiRa7KiA6+rpZvhrTcU+HB7DKYQPMM6hJOIpZXQg6Prwaq/G2r1C4ygDf1x p5VO69x5+B5MbKubIyj1nBNzxn4cwoUFh2WXeKlwHAanrI74h5NEPtMTSKXuh2Kp6qcK 62mEML3mT614cpgyfGI4nbZLxZH/d4myYnPj24FOlc4Tbow7x3bwUORGHgspnwduO7/+ jeiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/mOEsnamgxB8Ptrn7kdnXLT9Nq+Lteh2fzq+UpbC5EI=; b=cMgyjhmD4PCLfgyNJLNbMCowSfL2ea+T+Q1ldb9y970V0KkQK6e60GNCgajIkjVTr3 7U+hQmO0SYn2EVM7V6RvwtTfy1Ya4/wux0GcNl8hgu5tNBVoArkVZ4yX8/XJ4l2IYYmE fSRb7tSsls0YXwvoBj7iAXKfEHfXjb4+z9xr0GKTqClN1DrdariAefDlB3EuuDNFY4Yu QAdXWm+ic1eUzNkqtGxPUYrp7i6lhOgbslMKKDDMTxAB+kAHHe+PvTiDbL0QgY+I3TkE FIj7bFxrFwLJIXlFKM3drrl5/jqxMXjDvk8fBIe1UhMTYwaxgWmqiy6pkY8RPd2Qi1DD 4ubw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I1qJZ6nV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z31-v6si19319460plb.58.2018.10.08.11.49.44; Mon, 08 Oct 2018 11:49:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=I1qJZ6nV; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731676AbeJICBd (ORCPT + 99 others); Mon, 8 Oct 2018 22:01:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:50614 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731667AbeJICBd (ORCPT ); Mon, 8 Oct 2018 22:01:33 -0400 Received: from localhost (ip-213-127-77-176.ip.prioritytelecom.net [213.127.77.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 23BEE214C4; Mon, 8 Oct 2018 18:48:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539024506; bh=S90ZsJHK/axGvNAlnPADTywXEw0IKBbR8xhtqOb05LY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=I1qJZ6nV2K/4ZhD+NeSBJHPvZHL2iAu6h6muAb2JazWQsT74B7ywFO1N487FMJD6s h9Hq26xyxCXlFFwYW+x6c0bgwhXsVMHKxAPhe4G/AEViFqfBksTXjwycMLaulq+Wa/ hbqUFch1VFdloNMZT+cuURsD9A8Yv/QR9b/hfVHY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Raspl , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Sasha Levin Subject: [PATCH 4.18 040/168] tools/kvm_stat: fix python3 issues Date: Mon, 8 Oct 2018 20:30:20 +0200 Message-Id: <20181008175621.572285969@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181008175620.043587728@linuxfoundation.org> References: <20181008175620.043587728@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Stefan Raspl [ Upstream commit 58f33cfe73076b6497bada4f7b5bda961ed68083 ] Python3 returns a float for a regular division - switch to a division operator that returns an integer. Furthermore, filters return a generator object instead of the actual list - wrap result in yet another list, which makes it still work in both, Python2 and 3. Signed-off-by: Stefan Raspl Signed-off-by: Radim Krčmář Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- tools/kvm/kvm_stat/kvm_stat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/tools/kvm/kvm_stat/kvm_stat +++ b/tools/kvm/kvm_stat/kvm_stat @@ -759,7 +759,7 @@ class DebugfsProvider(Provider): if len(vms) == 0: self.do_read = False - self.paths = filter(lambda x: "{}-".format(pid) in x, vms) + self.paths = list(filter(lambda x: "{}-".format(pid) in x, vms)) else: self.paths = [] @@ -1219,10 +1219,10 @@ class Tui(object): (x, term_width) = self.screen.getmaxyx() row = 2 for line in text: - start = (term_width - len(line)) / 2 + start = (term_width - len(line)) // 2 self.screen.addstr(row, start, line) row += 1 - self.screen.addstr(row + 1, (term_width - len(hint)) / 2, hint, + self.screen.addstr(row + 1, (term_width - len(hint)) // 2, hint, curses.A_STANDOUT) self.screen.getkey()