gpg: use shutil.which() for Python 3

This commit is contained in:
Roman Zeyde
2017-11-02 17:10:09 +02:00
parent 47a8a53247
commit d52f295326
3 changed files with 23 additions and 11 deletions

View File

@@ -129,8 +129,7 @@ def run_init(device_type, args):
check_call(['mkdir', '-p', homedir])
check_call(['chmod', '700', homedir])
agent_path = check_output(['which', '{}-gpg-agent'.format(device_name)])
agent_path = agent_path.strip()
agent_path = util.which('{}-gpg-agent'.format(device_name))
# Prepare GPG configuration file
with open(os.path.join(homedir, 'gpg.conf'), 'w') as f: