From a3eb124033ea6cf58421ac01fd6a99dcab156023 Mon Sep 17 00:00:00 2001 From: Vladimir Iakovlev Date: Sun, 14 Aug 2016 08:39:26 +0300 Subject: [PATCH] #N/A: Disable `port_already_in_use` on systems without `lsof` --- thefuck/rules/port_already_in_use.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/thefuck/rules/port_already_in_use.py b/thefuck/rules/port_already_in_use.py index 43171d6..8264775 100644 --- a/thefuck/rules/port_already_in_use.py +++ b/thefuck/rules/port_already_in_use.py @@ -1,8 +1,10 @@ import re from subprocess import Popen, PIPE -from thefuck.utils import memoize +from thefuck.utils import memoize, which from thefuck.shells import shell +enabled_by_default = bool(which('lsof')) + patterns = [r"bind on address \('.*', (?P\d+)\)", r'Unable to bind [^ ]*:(?P\d+)', r"can't listen on port (?P\d+)",