Re: [PATCH] selftests/tpm2: Change exception handling to be Python 3 compatible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Jarkko,

On 12 Apr 2020, at 19:07, Jarkko Sakkinen <jarkko.sakkinen@xxxxxxxxxxxxxxx> 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 <jarkko.sakkinen@xxxxxxxxxxxxxxx> 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'

What I suggested is the standard syntax:
https://docs.python.org/3/tutorial/errors.html

Did you test this? You should get an error as soon as an exception
occurs.

Cheers,
Ezra.





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux