diff --git a/pyGPG/output.py b/pyGPG/output.py index c6df701..eb4905e 100644 --- a/pyGPG/output.py +++ b/pyGPG/output.py @@ -162,8 +162,9 @@ def returncode(self): @rtype int ''' - return self.gpg.returncode - + if self.gpg: + return self.gpg.returncode or -1 + return -1 @property def no_pubkey(self):