diff --git a/pybind11/setup_helpers.py b/pybind11/setup_helpers.py index 4c14498f6..1db479532 100644 --- a/pybind11/setup_helpers.py +++ b/pybind11/setup_helpers.py @@ -174,9 +174,7 @@ class Pybind11Extension(_Extension): # type: ignore[misc] @cxx_std.setter def cxx_std(self, level: int) -> None: if self._cxx_level: - warnings.warn( - "You cannot safely change the cxx_level after setting it!", stacklevel=1 - ) + warnings.warn("You cannot safely change the cxx_level after setting it!") # MSVC 2015 Update 3 and later only have 14 (and later 17) modes, so # force a valid flag here.