def _getPython(self, macros, path):
        """
        Takes a path
        Returns, for that path, a tuple of
            - the preferred instance of python to use
            - whether that instance is in the destdir
        """
        m = self.recipe.magic[path]
        if m and m.name == 'script' and 'python' in m.contents['interpreter']:
            pythonPath = [m.contents['interpreter']]
        else:
            pythonVersion = self._getPythonVersionFromPath(path, None)
            # After PATH, fall back to %(bindir)s.  If %(bindir)s should be
            # preferred, it needs to be earlier in the PATH.  Include
            # unversioned python as a last resort for confusing cases.
            shellPath = os.environ.get('PATH', '').split(':') + [ '%(bindir)s' ]
            pythonPath = []
            if pythonVersion:
                pythonPath = [ os.path.join(x, pythonVersion) for x in shellPath ]
            pythonPath.extend([ os.path.join(x, 'python') for x in shellPath ])

        for pathElement in pythonPath:
            pythonDestPath = ('%(destdir)s'+pathElement) %macros
            if os.access(pythonDestPath, os.X_OK):
                return (pythonDestPath, True)
        for pathElement in pythonPath:
            pythonDestPath = pathElement %macros
            if os.access(pythonDestPath, os.X_OK):
                self._enforceProvidedPath(pythonDestPath)
                return (pythonDestPath, False)

        # Specified python not found on system (usually because of
        # bad interpreter path -- CNY-2050)
        if len(pythonPath) == 1:
            missingPythonPath = '%s ' % pythonPath[0]
        else:
            missingPythonPath = ''
        self.warn('Python interpreter %snot found for %s',
                  missingPythonPath, path)
        return (None, None)