Commit 8d9f4d50 by Henry Schreiner Committed by GitHub

fix: quote paths from pybind11-config (#5302)

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
parent 1fe92c7b
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
from __future__ import annotations from __future__ import annotations
import argparse import argparse
import shlex
import sys import sys
import sysconfig import sysconfig
...@@ -22,7 +23,7 @@ def print_includes() -> None: ...@@ -22,7 +23,7 @@ def print_includes() -> None:
if d and d not in unique_dirs: if d and d not in unique_dirs:
unique_dirs.append(d) unique_dirs.append(d)
print(" ".join("-I" + d for d in unique_dirs)) print(" ".join(shlex.quote(f"-I{d}") for d in unique_dirs))
def main() -> None: def main() -> None:
...@@ -54,9 +55,9 @@ def main() -> None: ...@@ -54,9 +55,9 @@ def main() -> None:
if args.includes: if args.includes:
print_includes() print_includes()
if args.cmakedir: if args.cmakedir:
print(get_cmake_dir()) print(shlex.quote(get_cmake_dir()))
if args.pkgconfigdir: if args.pkgconfigdir:
print(get_pkgconfig_dir()) print(shlex.quote(get_pkgconfig_dir()))
if __name__ == "__main__": if __name__ == "__main__":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment