Factor out unnecessary parsing for the presence of the passphrase fd.
parent
c96aed31ed
commit
24da4d186c
8
gnupg.py
8
gnupg.py
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue