Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4834087ybb; Tue, 14 Apr 2020 15:12:31 -0700 (PDT) X-Google-Smtp-Source: APiQypKt4MoDF1aGlWFtj/ZWCaDOrAMja+gtlT+oME+0BTqIzDaU2hxqvP+2xq3RkmbPKwi9/hlv X-Received: by 2002:a05:6402:791:: with SMTP id d17mr22874753edy.5.1586902351563; Tue, 14 Apr 2020 15:12:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586902351; cv=none; d=google.com; s=arc-20160816; b=ZpQCBxGyv+bPuJ4vWzu/d/vc9f5KIeVkDW2/DBsaoEZjPFD0aUdzoc7HRrRuPcWdv5 F7wE+RLisuWBf94NFGwvVIMg2/ta46hnbaumZwnyIJxynAGU5ORfQE5PpJIcid9GT+7O EQ3LaWuKw4sKfU18bTXmGj4i4EO8xC0dCxdBtnEoNEdGwtEc/UmpAl//2hJCItkzxE26 ZeuxPpGdvJrl2Ju/J7uUupZiDNzd/2bzp7S3Oai/CX09bG6NKyF4/O4BTnUGjaFC3yij DKcWiuB4S39I8I7Ycvc+9krxaByY1pATYrHBnHysUbo6A81sG+VQ+01MpPCsqCYGxhK1 tLWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=dL2nXkXAHXJxNvwi65PC8/OhfeaFsj5A88OfOh7UYAg=; b=ajg983BJshk35HCPYET9HkG4xLm8JJ1xwidUefr8GBBdXk2dOxaeDJcyGWw260xeFt OTLUnnR5b3Jm6yBTJaZLyoJVA2KTSeXvRLPfq+etsJBdYunklftsTon9DkbHlbD9NHHL C4D7LypG9icBFuznEx7bIIZUzEnUaRIKBnXkLg16jDqgGgmAaHmRBkCWdeG6A86nnluw /s1U88dAxFZtD16EOiHjj0fUyBhvh8utMEgyURC4IUFuOVUk0I6VksW1KzCfVYrVssNt RNdRnQ16MEmYR0WNbMCmgYTyNMQvgL5tPBan/hARyKK+fb1VxDm5XVvQahaMqULo1CoW 09Ew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y12si12755764edm.449.2020.04.14.15.12.07; Tue, 14 Apr 2020 15:12:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387609AbgDMSE7 (ORCPT + 99 others); Mon, 13 Apr 2020 14:04:59 -0400 Received: from mga14.intel.com ([192.55.52.115]:21995 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387498AbgDMSE5 (ORCPT ); Mon, 13 Apr 2020 14:04:57 -0400 IronPort-SDR: vJilkxm2cgYF+COsdmieKZZulFmGLwHKxnPNAAm8yeYy2iwXqwkDPu4E8xCYNC/QlO+OVUv5SR 7vFa3lJmoPIg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2020 11:04:56 -0700 IronPort-SDR: 2Jv2GVqHHih2DWxtcSjbsstTeFF/7vWompjE/cJJAd4lhG+cYngayireNFDKpAD1Lgod8I+DTo fd87PsO8483w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,378,1580803200"; d="scan'208";a="252946877" Received: from sarsteda-mobl1.ger.corp.intel.com (HELO localhost) ([10.249.40.211]) by orsmga003.jf.intel.com with ESMTP; 13 Apr 2020 11:04:53 -0700 Date: Mon, 13 Apr 2020 21:04:52 +0300 From: Jarkko Sakkinen To: Ezra Buehler Cc: Shuah Khan , linux-kselftest@vger.kernel.org, linux-integrity@vger.kernel.org, Tadeusz Struk , open list Subject: Re: [PATCH] selftests/tpm2: Change exception handling to be Python 3 compatible Message-ID: <20200413180440.GA10917@linux.intel.com> References: <20200412143656.72955-1-jarkko.sakkinen@linux.intel.com> <1FE03B4F-C42C-4B5F-A4B5-8169705911FA@easyb.ch> <20200412170719.GA324408@linux.intel.com> <531D50E8-E8FC-402E-9226-6000E8B6E960@easyb.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <531D50E8-E8FC-402E-9226-6000E8B6E960@easyb.ch> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 13, 2020 at 07:02:20AM +0200, Ezra Buehler wrote: > Hi Jarkko, > > On 12 Apr 2020, at 19:07, Jarkko Sakkinen wrote: > > > > On Sun, Apr 12, 2020 at 05:02:27PM +0200, Ezra Buehler wrote: > >> Hi Jarkkon, > >> > >>> On 12 Apr 2020, at 16:36, Jarkko Sakkinen wrote: > >>> + except ProtocolError(e): > >> > >> Should this not be > >> > >> except ProtocolError as e: > > > > Unless there is a functional difference, does it matter? > > > > /Jarkko > > Well, your patch confuses me a lot. It looks to me like you are passing > the undefined `e` variable to the constructor. > > When I run flake8 on it I get following error (among others): > > F821 undefined name 'e' I don't know what flake8 is. > What I suggested is the standard syntax: > https://docs.python.org/3/tutorial/errors.html It passed the Python 3 interpreter. > Did you test this? You should get an error as soon as an exception > occurs. Yes. Interpreter did not complain. I did not know that the language is broken that way that you have to exercise the code path to get a syntax error. /Jarkko