Skip to content

Commit a0c2be9

Browse files
committed
Gate _distutils_hack import.
1 parent 152d823 commit a0c2be9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sphinx_jinja2_compat/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,11 @@
7777
# or building from source or an eventual deliberate removal)
7878

7979
if sys.version_info >= (3, 12):
80-
# Ensure distutils is patched first
81-
__import__("_distutils_hack").add_shim()
80+
# Ensure distutils is patched first, if setuptools is installed
81+
try:
82+
__import__("_distutils_hack").add_shim()
83+
except ImportError:
84+
pass
8285

8386
try:
8487
# 3rd party

0 commit comments

Comments
 (0)