Only import distutils when type checking

This commit is contained in:
Andrew Murray 2025-01-25 18:23:34 +11:00 committed by Kevin Newton
parent cff21412c5
commit e2a96a5c2c

View File

@ -8,7 +8,6 @@
# ------------------------------
from __future__ import annotations
import distutils.ccompiler
import os
import re
import shutil
@ -18,12 +17,15 @@ import sys
import tempfile
import warnings
from collections.abc import Iterator
from typing import Any
from typing import TYPE_CHECKING, Any
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext
from setuptools.errors import CompileError
if TYPE_CHECKING:
import distutils.ccompiler
def get_version() -> str:
version_file = "src/PIL/_version.py"