It is unclear why we were not using this already. b3288d12 backported this script to Python 3.4, but `shutil.which` is already available there.