From 73fedd0c27c3ea2ee4cfb4c6b4b15b541cb7617b Mon Sep 17 00:00:00 2001 From: Ofek Lev Date: Thu, 30 Jan 2020 10:14:44 -0500 Subject: [PATCH] [gpg] Fix return code check --- securesystemslib/gpg/functions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/securesystemslib/gpg/functions.py b/securesystemslib/gpg/functions.py index cd1a057f..e102b9fb 100644 --- a/securesystemslib/gpg/functions.py +++ b/securesystemslib/gpg/functions.py @@ -99,7 +99,7 @@ def create_signature(content, keyid=None, homedir=None): # TODO: It's suggested to take a look at `--status-fd` for proper error # reporting, as there is no clear distinction between the return codes # https://lists.gnupg.org/pipermail/gnupg-devel/2005-December/022559.html - if process.returncode is not 0: + if process.returncode != 0: raise securesystemslib.gpg.exceptions.CommandError("Command '{}' returned " "non-zero exit status '{}', stderr was:\n{}.".format(process.args, process.returncode, process.stderr.decode()))