mirror of
https://github.com/samsonjs/vdirsyncer.git
synced 2026-04-27 14:57:41 +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])
|
command[0] = expand_path(command[0])
|
||||||
|
|
||||||
try:
|
try:
|
||||||
proc = subprocess.Popen(command + [username, host],
|
stdout = subprocess.check_output(command + [username, host],
|
||||||
stdout=subprocess.PIPE)
|
universal_newlines=True)
|
||||||
password = proc.stdout.read().decode('utf-8').strip()
|
return stdout.strip()
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
logger.warning('Failed to execute command: {}\n{}'.
|
logger.warning('Failed to execute command: {}\n{}'.
|
||||||
format(' '.join(command), str(e)))
|
format(' '.join(command), str(e)))
|
||||||
return None
|
|
||||||
|
|
||||||
return password
|
|
||||||
|
|
||||||
|
|
||||||
class _FingerprintAdapter(requests.adapters.HTTPAdapter):
|
class _FingerprintAdapter(requests.adapters.HTTPAdapter):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue