Skip to content

Commit 129267b

Browse files
authored
Use percent formatting for _dbg calls (#9035)
2 parents 2954964 + 18f8af7 commit 129267b

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

setup.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import sys
1717
import warnings
1818
from collections.abc import Iterator
19-
from typing import Any
2019

2120
from setuptools import Extension, setup
2221
from setuptools.command.build_ext import build_ext
@@ -148,7 +147,7 @@ class RequiredDependencyException(Exception):
148147
PLATFORM_MINGW = os.name == "nt" and "GCC" in sys.version
149148

150149

151-
def _dbg(s: str, tp: Any = None) -> None:
150+
def _dbg(s: str, tp: str | tuple[str, ...] | None = None) -> None:
152151
if DEBUG:
153152
if tp:
154153
print(s % tp)
@@ -509,11 +508,11 @@ def build_extensions(self) -> None:
509508

510509
if root is None and pkg_config:
511510
if isinstance(lib_name, str):
512-
_dbg(f"Looking for `{lib_name}` using pkg-config.")
511+
_dbg("Looking for `%s` using pkg-config.", lib_name)
513512
root = pkg_config(lib_name)
514513
else:
515514
for lib_name2 in lib_name:
516-
_dbg(f"Looking for `{lib_name2}` using pkg-config.")
515+
_dbg("Looking for `%s` using pkg-config.", lib_name2)
517516
root = pkg_config(lib_name2)
518517
if root:
519518
break
@@ -732,7 +731,7 @@ def build_extensions(self) -> None:
732731
best_path = os.path.join(directory, name)
733732
_dbg(
734733
"Best openjpeg version %s so far in %s",
735-
(best_version, best_path),
734+
(str(best_version), best_path),
736735
)
737736

738737
if best_version and _find_library_file(self, "openjp2"):

0 commit comments

Comments
 (0)