From 9379b399d99a784f7e226f135fb117aff6db8013 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 25 Oct 2021 16:01:19 -0400 Subject: [PATCH] fix: MSVC 2017 C++17 on Python 3 regression (#3407) * fix: MSVC 2017 C++17 on Python 3 regression * ci: add 3.7 job on CI --- .github/workflows/ci.yml | 4 ++++ include/pybind11/functional.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09b400056..b027640df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -851,6 +851,10 @@ jobs: std: 17 args: > -DCMAKE_CXX_FLAGS="/permissive- /EHsc /GR" + - python: 3.7 + std: 17 + args: > + -DCMAKE_CXX_FLAGS="/permissive- /EHsc /GR" steps: - uses: actions/checkout@v2 diff --git a/include/pybind11/functional.h b/include/pybind11/functional.h index 24141ce38..ad5608c25 100644 --- a/include/pybind11/functional.h +++ b/include/pybind11/functional.h @@ -69,7 +69,7 @@ public: // ensure GIL is held during functor destruction struct func_handle { function f; -#if !(defined(_MSC_VER) && _MSC_VER == 1916 && defined(PYBIND11_CPP17) && PY_MAJOR_VERSION < 3) +#if !(defined(_MSC_VER) && _MSC_VER == 1916 && defined(PYBIND11_CPP17)) // This triggers a syntax error under very special conditions (very weird indeed). explicit #endif