diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4b9681984..ba9955a31 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -32,7 +32,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] @@ -71,7 +71,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 782fb20d4..a0e32281b 100644 --- a/include/pybind11/cast.h +++ b/include/pybind11/cast.h @@ -1625,7 +1625,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."); }