Skip to content

Commit 0f1872c

Browse files
build: use bin path override if no python is found in PATH
On systems with no "python" in the PATH, e.g. FreeBSD, we should always create a python symlink in get_bin_override(). Otherwise, configure fails with the following error: Traceback (most recent call last): File "./configure", line 1461, in <module> bin_override = get_bin_override() File "./configure", line 1360, in get_bin_override if os.path.realpath(which('python')) == os.path.realpath(sys.executable): File "/usr/local/lib/python2.7/posixpath.py", line 375, in realpath path, ok = _joinrealpath('', filename, {}) File "/usr/local/lib/python2.7/posixpath.py", line 381, in _joinrealpath if isabs(rest): File "/usr/local/lib/python2.7/posixpath.py", line 54, in isabs return s.startswith('/') AttributeError: 'NoneType' object has no attribute 'startswith'
1 parent ff747e3 commit 0f1872c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

configure

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,9 @@ def get_bin_override():
13571357
# sys.executable. This directory will be prefixed to the PATH, so that
13581358
# other tools that shell out to `python` will use the appropriate python
13591359

1360-
if os.path.realpath(which('python')) == os.path.realpath(sys.executable):
1360+
which_python = which('python')
1361+
if (which_python and
1362+
os.path.realpath(which_python) == os.path.realpath(sys.executable)):
13611363
return
13621364

13631365
bin_override = os.path.abspath('out/tools/bin')

0 commit comments

Comments
 (0)