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