mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-03-25 08:55:50 +00:00
Rely on Python 3 to decode stdout.
This commit is contained in:
parent
14f7da4e04
commit
37551b376f
1 changed files with 3 additions and 6 deletions
|
|
@ -187,15 +187,12 @@ def _password_from_command(username, host):
|
|||
command[0] = expand_path(command[0])
|
||||
|
||||
try:
|
||||
proc = subprocess.Popen(command + [username, host],
|
||||
stdout=subprocess.PIPE)
|
||||
password = proc.stdout.read().decode('utf-8').strip()
|
||||
stdout = subprocess.check_output(command + [username, host],
|
||||
universal_newlines=True)
|
||||
return stdout.strip()
|
||||
except OSError as e:
|
||||
logger.warning('Failed to execute command: {}\n{}'.
|
||||
format(' '.join(command), str(e)))
|
||||
return None
|
||||
|
||||
return password
|
||||
|
||||
|
||||
class _FingerprintAdapter(requests.adapters.HTTPAdapter):
|
||||
|
|
|
|||
Loading…
Reference in a new issue