From 677a5d4c688a0115d5a22b3d8bfb39ea0da2f7e1 Mon Sep 17 00:00:00 2001 From: Roselyne Chotin-Avot Date: Wed, 2 Aug 2017 11:41:08 +0200 Subject: [PATCH] In coriolisEnv.py more robust take account of ps --- bootstrap/coriolisEnv.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bootstrap/coriolisEnv.py b/bootstrap/coriolisEnv.py index e359cf8d..0a3c8502 100755 --- a/bootstrap/coriolisEnv.py +++ b/bootstrap/coriolisEnv.py @@ -147,7 +147,7 @@ def guessShell (): #if os.environ.has_key('SHELL'): return os.environ['SHELL'] psCommand = subprocess.Popen ( ['ps', '-p', str(os.getppid()) ], stdout=subprocess.PIPE ) - shell = psCommand.stdout.readlines()[1][:-1].split()[-1].lstrip('-') + shell = psCommand.stdout.readlines()[1][:-1].split()[3].lstrip('-') whichCommand = subprocess.Popen ( ['which', shell ], stdout=subprocess.PIPE ) shellPath = whichCommand.stdout.readlines()[0][:-1] @@ -273,9 +273,10 @@ if __name__ == "__main__": or osType.startswith("Linux.sl") \ or osType.startswith("Linux.el") \ or osType.startswith("Linux.fc") \ - or osType.startswith("Darwin") \ or osType.startswith("Cygwin"): sitePackagesDir = "%s/python%s/site-packages" % (absLibDir,version) + elif osType.startswith("Darwin"): + sitePackagesDir = "%s/%s/site-packages" % (absLibDir,version) else: sitePackagesDir = "%s/python%s/dist-packages" % (absLibDir,version)