From 8b29a34b210e95ed9064515b75346487f7ff56c7 Mon Sep 17 00:00:00 2001 From: Knut Ahlers Date: Thu, 14 Dec 2017 15:02:20 +0100 Subject: [PATCH] Port to python3 --- bin/git-loadkey | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/git-loadkey b/bin/git-loadkey index 05702bc..3d5dd25 100755 --- a/bin/git-loadkey +++ b/bin/git-loadkey @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # Usage: git loadkey # @@ -21,15 +21,15 @@ CONFIG = os.path.expanduser('~/.config/git-committerconfig.json') def main(): try: - repos = [x.split()[1] for x in subprocess.check_output(['git', 'remote', '-v']).split('\n') if len(x.strip()) > 0] + repos = [x.split()[1] for x in subprocess.check_output(['git', 'remote', '-v'], universal_newlines=True).split('\n') if len(x.strip()) > 0] except: - print 'Could not find origin, not loading key.' + print('Could not find origin, not loading key.') return 0 if os.path.isfile(CONFIG): combinations = json.loads(open(CONFIG).read()) else: - print 'Config ({}) found.'.format(CONFIG) + print('Config ({}) found.'.format(CONFIG)) return 1 required_keys = [] @@ -41,7 +41,7 @@ def main(): break for key in sorted(set(required_keys)): - print 'Loading key "{}"...'.format(key) + print('Loading key "{}"...'.format(key)) subprocess.check_call(['vault-sshadd', key]) return 0