Fixing Python 3 syntax errors in tpm2_tests.py

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

 



Hello,

    As my very first contribution to the Linux Kernel, I would like to fix six Python 3 syntax errors in the file ./tools/testing/selftests/tpm2/tpm2_tests.py

    All six of these errors are of the same form: except ProtocolError, e:  To fix the syntax errors, I propose to change the comma (,) to “as” like:  except ProtocolError as e:

    These changes are important because the current form is compatible with Python 2 but is a syntax error in Python 3.  The proposed form is compatible with both Python 2 and Python3.  This conversion is required because Python 2 will reach its end of life in less than 200 days.

    The kernel contains at least five other files where I am able to detect Python 3 syntax errors but after studying in detail the process of making kernel modification, I believe that it is best to start with tpm2_tests.py because the changes are straightforward and uncontroversial — all issues are of the same form, and I can detect no other issues (such as undefined names) to fix in that file.

   If I succeed in getting the modifications to tpm2_tests.py through the review process then I can try the remaining files in turn.

   I would be interested to know if this is a worthwhile effort.  Is there already another initiative to resolve these issue before yearend?

   Thanks for any advise that you can provide, Chris Clauss



[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