Skip to content

Commit

Permalink
fix: quote paths from pybind11-config (google#5302)
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii authored Aug 13, 2024
1 parent 1fe92c7 commit 8d9f4d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pybind11/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from __future__ import annotations

import argparse
import shlex
import sys
import sysconfig

Expand All @@ -22,7 +23,7 @@ def print_includes() -> None:
if d and d not in unique_dirs:
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:
Expand Down Expand Up @@ -54,9 +55,9 @@ def main() -> None:
if args.includes:
print_includes()
if args.cmakedir:
print(get_cmake_dir())
print(shlex.quote(get_cmake_dir()))
if args.pkgconfigdir:
print(get_pkgconfig_dir())
print(shlex.quote(get_pkgconfig_dir()))


if __name__ == "__main__":
Expand Down

0 comments on commit 8d9f4d5

Please sign in to comment.