def check_git ( ) : try : with open ( os . devnull , "wb" ) as devnull : subprocess . check_call ( [ "git" , "--version" ] , stdout = devnull , stderr = devnull ) except : raise RuntimeError ( "Please make sure git is installed and on your path." )
how do i stop git from running python
Check if git command is available .
def check_git():
    """Check if git command is available."""
    try:
        with open(os.devnull, "wb") as devnull:
            subprocess.check_call(["git", "--version"], stdout=devnull, stderr=devnull)
    except:
        raise RuntimeError("Please make sure git is installed and on your path.")