mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-07-03 19:33:07 +03:00
Use percent formatting for _dbg calls (#9035)
This commit is contained in:
commit
129267bc82
9
setup.py
9
setup.py
|
@ -16,7 +16,6 @@ import subprocess
|
||||||
import sys
|
import sys
|
||||||
import warnings
|
import warnings
|
||||||
from collections.abc import Iterator
|
from collections.abc import Iterator
|
||||||
from typing import Any
|
|
||||||
|
|
||||||
from setuptools import Extension, setup
|
from setuptools import Extension, setup
|
||||||
from setuptools.command.build_ext import build_ext
|
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
|
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 DEBUG:
|
||||||
if tp:
|
if tp:
|
||||||
print(s % tp)
|
print(s % tp)
|
||||||
|
@ -509,11 +508,11 @@ class pil_build_ext(build_ext):
|
||||||
|
|
||||||
if root is None and pkg_config:
|
if root is None and pkg_config:
|
||||||
if isinstance(lib_name, str):
|
if isinstance(lib_name, str):
|
||||||
_dbg(f"Looking for `{lib_name}` using pkg-config.")
|
_dbg("Looking for `%s` using pkg-config.", lib_name)
|
||||||
root = pkg_config(lib_name)
|
root = pkg_config(lib_name)
|
||||||
else:
|
else:
|
||||||
for lib_name2 in lib_name:
|
for lib_name2 in lib_name:
|
||||||
_dbg(f"Looking for `{lib_name2}` using pkg-config.")
|
_dbg("Looking for `%s` using pkg-config.", lib_name2)
|
||||||
root = pkg_config(lib_name2)
|
root = pkg_config(lib_name2)
|
||||||
if root:
|
if root:
|
||||||
break
|
break
|
||||||
|
@ -732,7 +731,7 @@ class pil_build_ext(build_ext):
|
||||||
best_path = os.path.join(directory, name)
|
best_path = os.path.join(directory, name)
|
||||||
_dbg(
|
_dbg(
|
||||||
"Best openjpeg version %s so far in %s",
|
"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"):
|
if best_version and _find_library_file(self, "openjp2"):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user