Skip to content

Commit 45eaee9

Browse files
committed
fix: quote paths from pybind11-config (#5302)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 835139f commit 45eaee9

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pybind11/__main__.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from __future__ import annotations
33

44
import argparse
5+
import shlex
56
import sys
67
import sysconfig
78

@@ -22,7 +23,7 @@ def print_includes() -> None:
2223
if d and d not in unique_dirs:
2324
unique_dirs.append(d)
2425

25-
print(" ".join("-I" + d for d in unique_dirs))
26+
print(" ".join(shlex.quote(f"-I{d}") for d in unique_dirs))
2627

2728

2829
def main() -> None:
@@ -54,9 +55,9 @@ def main() -> None:
5455
if args.includes:
5556
print_includes()
5657
if args.cmakedir:
57-
print(get_cmake_dir())
58+
print(shlex.quote(get_cmake_dir()))
5859
if args.pkgconfigdir:
59-
print(get_pkgconfig_dir())
60+
print(shlex.quote(get_pkgconfig_dir()))
6061

6162

6263
if __name__ == "__main__":

0 commit comments

Comments
 (0)