Isolate the commands that raise OSError Right now, running the git and hg commands could easily raise an OSError. Let's only catch it in those cases and then use else to install hooks when those are successful. Otherwise, pass on to the next supported VCS