This should work fine on systems with only Python3, only Python2 and also with both versions installed and do not rely on just being "python" available in $PATH. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/2572
-- Commit Summary --
* Use Python interpreter detected by autotools for geany-gtkdoc.h
-- File Changes --
M doc/Makefile.am (2)
-- Patch Links --
https://github.com/geany/geany/pull/2572.patch https://github.com/geany/geany/pull/2572.diff