mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-01-20 21:53:42 +08:00
Appease new flake8 B028 error: (#4513)
```
flake8...................................................................Failed
- hook id: flake8
- exit code: 1
pybind11/setup_helpers.py:177:13: B028 No explicit stacklevel keyword argument found. The warn method from the warnings module uses a stacklevel of 1 by default. This will only show a stack trace for the line on which the warn method is called. It is therefore recommended to use a stacklevel of 2 or greater to provide more information to the user.
warnings.warn("You cannot safely change the cxx_level after setting it!")
^
```
This commit is contained in:
parent
08a4a47a6c
commit
d1956eabb5
@ -174,7 +174,9 @@ 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!")
|
||||
warnings.warn(
|
||||
"You cannot safely change the cxx_level after setting it!", stacklevel=1
|
||||
)
|
||||
|
||||
# MSVC 2015 Update 3 and later only have 14 (and later 17) modes, so
|
||||
# force a valid flag here.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user