Factor out unnecessary parsing for the presence of the passphrase fd.

feature/documentation-builds-html
Isis Lovecruft 2013-04-10 19:15:43 +00:00
parent c96aed31ed
commit 24da4d186c
No known key found for this signature in database
GPG Key ID: A3ADB67A2CDB8B35
1 changed files with 2 additions and 6 deletions

View File

@ -1308,15 +1308,11 @@ class GPG(object):
stderr.close() stderr.close()
stdout.close() stdout.close()
def _handle_io(self, args, file, result, passphrase=None, binary=False): def _handle_io(self, args, file, result, passphrase=False, binary=False):
""" """
Handle a call to GPG - pass input data, collect output data. Handle a call to GPG - pass input data, collect output data.
""" """
if passphrase is not None: p = self._open_subprocess(args, passphrase)
ask_passphrase = True
else:
ask_passphrase = False
p = self._open_subprocess(args, ask_passphrase)
if not binary: if not binary:
stdin = codecs.getwriter(self.encoding)(p.stdin) stdin = codecs.getwriter(self.encoding)(p.stdin)
else: else: