Mercurial > hg
changeset 24614:241d98d84aed
ssl: resolve symlink before checking for Apple python executable (issue4588)
test-https.t was broken at 07fafcd4bc74 if /usr/bin/pythonX.Y is used on
Mac OS X.
If python executable is not named as "python", run-tests.py creates a symlink
and hghave uses it. On the other hand, the installed hg executable knows the
real path to the system Python. Therefore, there was an inconsistency that
hghave said it was not an Apple python but hg knew it was.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 04 Apr 2015 14:56:18 +0900 |
parents | f8bc3de9b343 |
children | 9e558b788daa |
files | mercurial/sslutil.py |
diffstat | 1 files changed, 2 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/sslutil.py Fri Apr 03 18:19:24 2015 -0400 +++ b/mercurial/sslutil.py Sat Apr 04 14:56:18 2015 +0900 @@ -129,9 +129,9 @@ for using system certificate store CAs in addition to the provided cacerts file """ - if sys.platform != 'darwin' or util.mainfrozen(): + if sys.platform != 'darwin' or util.mainfrozen() or not sys.executable: return False - exe = (sys.executable or '').lower() + exe = os.path.realpath(sys.executable).lower() return (exe.startswith('/usr/bin/python') or exe.startswith('/system/library/frameworks/python.framework/'))