the Python executable is not on the path, in a framework build (e.g. from Python.org), it's in the framework - something like `/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python`.  You have really changed what this test means - it was a test for the short-circuit code:

> does the string 'python' give back `sys.executable`?

But you changed it to something else:

> does the string basename(sys.executable) give back `sys.executable`?

Which does not describe the behavior of the code this tests, so it fails in some cases.  PR #3342 reconciles the code with the test.