mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-21 20:38:54 +00:00
Merge pull request #539 from blahgeek/master
prevent infinity loop while detecting shell
This commit is contained in:
commit
faeeef7666
@ -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