In this case I would simply skip the `pandoc_available` call and put the rest inside a try...except. The reasoning comes after:

Indeed, there is code duplication. But I don't think putting the version extraction inside "pandoc_available" is clean on the logical/conceptual/semantic side. 

What I mean is that ideally, in order to reduce places where we build and call command lines, there would be a single wrapper function `pandoc` which would wrap around the pandoc executable with many options. But that function would need to check if pandoc is available, thus calling `pandoc_available(...)` which in turn would need to call the `pandoc(get_version=True)` (because it is the easiest way to make pandoc return immediately), which would need to make sure that pandoc is available... it bites its tail. 

Similarly `get_pandoc_version` would be a shortcut for `pandoc(get_version=True)` inducing `pandoc_available()` -> `pandoc(get_version=True)` ... infinite recursion!

So in these cases I prefer having a few duplicates to avoid later recursion problems (when refactoring or extending the module). They serve as recursion stoppers. It also keeps the code more understandable, well at least for me as recursions drive me nuts :)