From d2e511fa2c591738ba83cb3ba199536cff709785 Mon Sep 17 00:00:00 2001 From: Pablo Santiago Blum de Aguiar Date: Wed, 13 May 2015 10:36:00 -0300 Subject: [PATCH 1/2] refact(brew_install): remove an unused import Signed-off-by: Pablo Santiago Blum de Aguiar --- thefuck/rules/brew_install.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/thefuck/rules/brew_install.py b/thefuck/rules/brew_install.py index 0f339506..597a8f8b 100644 --- a/thefuck/rules/brew_install.py +++ b/thefuck/rules/brew_install.py @@ -3,8 +3,6 @@ import os import re from subprocess import check_output -import thefuck.logs - # Formulars are base on each local system's status brew_formulas = [] try: From 9cf41f8e439d89d4f8614069e70fa86b3d91be39 Mon Sep 17 00:00:00 2001 From: Pablo Santiago Blum de Aguiar Date: Wed, 13 May 2015 10:36:46 -0300 Subject: [PATCH 2/2] fix(brew_install): make subprocess.check_output return str This fix makes the `brew_install` rule work on Python 3. Signed-off-by: Pablo Santiago Blum de Aguiar --- thefuck/rules/brew_install.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/thefuck/rules/brew_install.py b/thefuck/rules/brew_install.py index 597a8f8b..39deb236 100644 --- a/thefuck/rules/brew_install.py +++ b/thefuck/rules/brew_install.py @@ -6,7 +6,8 @@ from subprocess import check_output # Formulars are base on each local system's status brew_formulas = [] try: - brew_path_prefix = check_output(['brew', '--prefix']).strip() + brew_path_prefix = check_output(['brew', '--prefix'], + universal_newlines=True).strip() brew_formula_path = brew_path_prefix + '/Library/Formula' for file_name in os.listdir(brew_formula_path):