mirror of
https://github.com/nvbn/thefuck.git
synced 2025-04-19 17:20:39 +01:00
#623: Fix UnicodeDecodeError
with Python 2
This commit is contained in:
parent
99c10b50ff
commit
2af54d036d
@ -111,12 +111,15 @@ def get_all_executables():
|
|||||||
tf_entry_points = get_installation_info().get_entry_map()\
|
tf_entry_points = get_installation_info().get_entry_map()\
|
||||||
.get('console_scripts', {})\
|
.get('console_scripts', {})\
|
||||||
.keys()
|
.keys()
|
||||||
|
|
||||||
bins = [exe.name.decode('utf8') if six.PY2 else exe.name
|
bins = [exe.name.decode('utf8') if six.PY2 else exe.name
|
||||||
for path in os.environ.get('PATH', '').split(':')
|
for path in os.environ.get('PATH', '').split(':')
|
||||||
for exe in _safe(lambda: list(Path(path).iterdir()), [])
|
for exe in _safe(lambda: list(Path(path).iterdir()), [])
|
||||||
if not _safe(exe.is_dir, True)
|
if not _safe(exe.is_dir, True)
|
||||||
and exe.name not in tf_entry_points]
|
and exe.name not in tf_entry_points]
|
||||||
aliases = [alias for alias in shell.get_aliases() if alias != tf_alias]
|
aliases = [alias.decode('utf8') if six.PY2 else alias
|
||||||
|
for alias in shell.get_aliases() if alias != tf_alias]
|
||||||
|
|
||||||
return bins + aliases
|
return bins + aliases
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user