diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index a2db9290b..5678c6009 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -33,7 +33,7 @@ repos: # Upgrade old Python syntax - repo: https://github.com/asottile/pyupgrade - rev: "v2.34.0" + rev: "v2.37.1" hooks: - id: pyupgrade args: [--py36-plus] @@ -73,7 +73,7 @@ repos: # Autoremoves unused imports - repo: https://github.com/hadialqattan/pycln - rev: "v1.3.5" + rev: "v2.0.1" hooks: - id: pycln stages: [manual] diff --git a/include/pybind11/cast.h b/include/pybind11/cast.h index 6955a589e..c7470aafa 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -1653,7 +1653,7 @@ unpacking_collector collect_arguments(Args &&...args) { template template object object_api::operator()(Args &&...args) const { -#if defined(PYBIND11_DETAILED_ERROR_MESSAGES) +#ifndef NDEBUG if (!PyGILState_Check()) { pybind11_fail("pybind11::object_api<>::operator() PyGILState_Check() failure."); }