def _is_shell(self, executable):
            """
            Determine if the specified executable is a script
            (contains a #! line)
            """
            try:
                with open(executable) as fp:
                    return fp.read(2) == '#!'
            except (OSError, IOError):
                logger.warning('Failed to open %s', executable)
                return False

            Determine if the specified executable is a script
            (contains a #! line)
            
product/gradle-plugin/src/main/python/pip/_vendor/distlib/scripts.py