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.
--- 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/'))