def _has_git():
 try:
  subprocess.check_call(['git', '--version'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
 except (OSError, subprocess.CalledProcessError):
  return False
 else:
  return True

def _has_git ( ) : try : subprocess . check_call ( [ 'git' , '--version' ] , stdout = subprocess . DEVNULL , stderr = subprocess . DEVNULL ) except ( OSError , subprocess . CalledProcessError ) : return False else : return True
check if git is installed .