Pass strings or tuples of strings to _dbg

This commit is contained in:
Andrew Murray 2025-06-24 20:35:09 +10:00
parent 1557585411
commit 18f8af78d3

View File

@ -16,7 +16,6 @@ import subprocess
import sys
import warnings
from collections.abc import Iterator
from typing import Any
from setuptools import Extension, setup
from setuptools.command.build_ext import build_ext
@ -148,7 +147,7 @@ class RequiredDependencyException(Exception):
PLATFORM_MINGW = os.name == "nt" and "GCC" in sys.version
def _dbg(s: str, tp: Any = None) -> None:
def _dbg(s: str, tp: str | tuple[str, ...] | None = None) -> None:
if DEBUG:
if tp:
print(s % tp)
@ -732,7 +731,7 @@ class pil_build_ext(build_ext):
best_path = os.path.join(directory, name)
_dbg(
"Best openjpeg version %s so far in %s",
(best_version, best_path),
(str(best_version), best_path),
)
if best_version and _find_library_file(self, "openjp2"):