mirror of
https://github.com/nvbn/thefuck.git
synced 2025-11-01 15:42:06 +00:00
prevent infinity loop while detecting shell
In OS X, Process(pid=0).parent() == Process(pid=0)
This commit is contained in:
@@ -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:
|
||||||
|
|||||||
Reference in New Issue
Block a user