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:
parent
070bb2ff28
commit
cfa51506fb
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user