# HG changeset patch # User Yuya Nishihara # Date 2015-04-04 05:56:18 # Node ID 241d98d84aed9af404d86e04df6ab4e41fd2225d # Parent f8bc3de9b3435ba314e264e015daa5d5684bb732 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. diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py --- a/mercurial/sslutil.py +++ b/mercurial/sslutil.py @@ -129,9 +129,9 @@ def _plainapplepython(): 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/'))