Skip to content

Commit 609269e

Browse files
vuillautclaude
andauthored
Replace removed distutils with shutil.which (#215)
distutils was removed from the stdlib in Python 3.12, breaking all imports of ctaplot on 3.12+. shutil.which is the drop-in replacement for distutils.spawn.find_executable. Claude-Session: https://claude.ai/code/session_01KyTy3FkRXDmP3UTLAnCtht Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 3d0d937 commit 609269e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

ctaplot/plots/style.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import matplotlib as mpl
2-
from distutils.spawn import find_executable
2+
from shutil import which
33
from contextlib import contextmanager
44
import logging
55
from ..io.dataset import get
@@ -15,11 +15,11 @@ def check_latex():
1515
-------
1616
bool: True if a LaTeX distribution with required packages could be found
1717
"""
18-
if not find_executable('latex'):
18+
if not which('latex'):
1919
return False
20-
20+
2121
# Check if dvipng is available (needed for matplotlib LaTeX rendering)
22-
if not find_executable('dvipng'):
22+
if not which('dvipng'):
2323
logger.warning("LaTeX found but dvipng is missing. Install dvipng for full LaTeX support.")
2424
return False
2525

0 commit comments

Comments
 (0)