From 64318c09b728e1bf45fd9c431139812d41bab917 Mon Sep 17 00:00:00 2001 From: nvbn Date: Mon, 11 May 2015 14:16:23 +0200 Subject: [PATCH] #161 support different psutils versions --- thefuck/shells.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/thefuck/shells.py b/thefuck/shells.py index e1203f45..2ed5c483 100644 --- a/thefuck/shells.py +++ b/thefuck/shells.py @@ -98,7 +98,10 @@ shells = defaultdict(lambda: Generic(), { def _get_shell(): - shell = Process(os.getpid()).parent().cmdline()[0] + try: + shell = Process(os.getpid()).parent().cmdline()[0] + except TypeError: + shell = Process(os.getpid()).parent.cmdline[0] return shells[shell]