(executable)
return magic == '#!'
Determine if the specified executable is a .sh (contains a #! line)
Determine if the specified executable is a .sh (contains a #! line)
Determine if the specified executable is a . sh ( contains a #! line )
def is_sh(executable):
    """Determine if the specified executable is a .sh (contains a #! line)"""
    try:
        with io.open(executable, encoding='latin-1') as fp:
            magic = fp.read(2)
    except (OSError, IOError):
        return executable
    return magic == '#!'
def is_sh ( executable ) : try : with io . open ( executable , encoding = 'latin-1' ) as fp : magic = fp . read ( 2 ) except ( OSError , IOError ) : return executable return magic == '#!'