From a0fdf0194a2e65e09edb7c62490f02cdbc952bb7 Mon Sep 17 00:00:00 2001 From: Markus Bauer Date: Thu, 5 Oct 2023 16:34:33 +0200 Subject: [PATCH] fix: Escape paths with spaces in include list from --includes --- pybind11/__main__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pybind11/__main__.py b/pybind11/__main__.py index b656ce6fee..17cea34284 100644 --- a/pybind11/__main__.py +++ b/pybind11/__main__.py @@ -2,6 +2,7 @@ from __future__ import annotations import argparse +import shlex import sys import sysconfig @@ -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("-I" + d) for d in unique_dirs)) def main() -> None: