Backport patch for python-3.12 compatibility

Can the following be backported: https://github.com/asciidoc-py/asciidoc-py/commit/cf72db316e3281249c6f69c5591a0092b231b53d

It prevents dozens of syntax warnings while building the docs for pacman!