python - GitPython: check if git is available -


gitpython depends on having command line version of git installed (otherwise, issue in question: oserror: [errno 2] no such file or directory on gitpython).

is there way gitpython api check if executable found, or, need wrap gitpython calls in exception handling account possibility?

i don't particularly recommend this, did @ least once: try 1 git command while catching oserror case see if can run git (and running it, capture git version number well, in case). if git fails run, complain , disable further invocations of git (or exit or whatever). if not, assume further invocations continue work.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -