1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-18 20:11:17 +00:00

prevent infinity loop while detecting shell

In OS X, Process(pid=0).parent() == Process(pid=0)
This commit is contained in:
BlahGeek 2016-08-20 12:00:03 +08:00
parent 070bb2ff28
commit cfa51506fb

View File

@ -22,7 +22,7 @@ shells = {'bash': Bash,
def _get_shell():
proc = Process(os.getpid())
while proc is not None:
while proc is not None and proc.pid > 0:
try:
name = proc.name()
except TypeError: