Skip to content
Snippets Groups Projects
Commit 3bfc10cc authored by erlanger's avatar erlanger Committed by Vassil Vassilev
Browse files

fix bug with os.readlink and regular files

parent 4beea1d8
Branches
Tags
No related merge requests found
......@@ -78,9 +78,18 @@ class ClingKernel(Kernel):
super(ClingKernel, self).__init__(**kwargs)
try:
whichCling = os.readlink(shutil.which('cling'))
except OSError as e:
#If cling is not a symlink try a regular file
#readlink returns POSIX error EINVAL (22) if the
#argument is not a symlink
if e.args[0] == 22:
whichCling = shutil.which('cling')
else:
raise e
except AttributeError:
from distutils.spawn import find_executable
whichCling = find_executable('cling')
if whichCling:
clingInstDir = os.path.dirname(os.path.dirname(whichCling))
llvmResourceDir = clingInstDir
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment