Skip to content

Commit e1cb553

Browse files
committed
Fix on Python 3.12+
1 parent e223bca commit e1cb553

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sphinx_jinja2_compat/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,13 @@
7575
# Ensure sphinx_prompt can also be imported from sphinx-prompt
7676
# (whether due to https://github.com/sbrunner/sphinx-prompt/issues/612
7777
# or building from source or an eventual deliberate removal)
78+
79+
if sys.version_info >= (3, 12):
80+
# Ensure distutils is patched first
81+
__import__("_distutils_hack").add_shim()
82+
7883
try:
84+
# 3rd party
7985
import sphinx_prompt
8086
except ImportError:
8187
pass

0 commit comments

Comments
 (0)