dotfiles

configuration files for shell, text editor, graphical environment, etc.
git clone git://src.adamsgaard.dk/dotfiles
Log | Files | Refs | README | LICENSE Back to index

commit 0cf67d049b9ab8f4e429b3942734a32fb2d57e97
parent caea76066382069a2c5007f2b72fedf18d0f1a78
Author: Anders Damsgaard <andersd@riseup.net>
Date:   Thu,  8 Mar 2018 11:41:20 -0500

Fix python-version issues by making password script cross compatible

Diffstat:
Mlinks/.mutt/offlineimap-password-store.py | 7+++++--
Mlinks/.mutt/offlineimap.py | 3++-
2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/links/.mutt/offlineimap-password-store.py b/links/.mutt/offlineimap-password-store.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python from subprocess import check_output def get_pass(account): @@ -6,4 +6,7 @@ def get_pass(account): if __name__ == "__main__": import sys - print(get_pass(sys.argv[1])) + if sys.version_info[0] < 3: + print(get_pass(sys.argv[1])) + else: + print(get_pass(sys.argv[1]).decode("utf-8")) diff --git a/links/.mutt/offlineimap.py b/links/.mutt/offlineimap.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python import re import subprocess import getpass @@ -52,3 +52,4 @@ if __name__ == '__main__': account = sys.argv[1] server = sys.argv[2] print(get_keychain_pass(account=account, server=server)) +