mirror of
https://github.com/nvbn/thefuck.git
synced 2025-04-15 07:10:52 +01: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():
|
def _get_shell():
|
||||||
proc = Process(os.getpid())
|
proc = Process(os.getpid())
|
||||||
|
|
||||||
while proc is not None:
|
while proc is not None and proc.pid > 0:
|
||||||
try:
|
try:
|
||||||
name = proc.name()
|
name = proc.name()
|
||||||
except TypeError:
|
except TypeError:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user