Do not run error_string() more than once

This commit is contained in:
Aaron Gokaslan 2022-02-14 11:49:26 -05:00
parent 6d0354b945
commit 2c5ad0bf9d
2 changed files with 2 additions and 3 deletions

View File

@ -402,8 +402,7 @@ jobs:
-DCMAKE_CXX_STANDARD=11 \
-DPYTHON_EXECUTABLE=$(python3 -c "import sys; print(sys.executable)") \
-DCMAKE_CXX_FLAGS="-Wc,--pending_instantiations=0" \
-DPYBIND11_TEST_FILTER="test_smart_ptr.cpp;test_virtual_functions.cpp" \
-DCMAKE_BUILD_TYPE=Debug
-DPYBIND11_TEST_FILTER="test_smart_ptr.cpp;test_virtual_functions.cpp"\
# Building before installing Pip should produce a warning but not an error
- name: Build

View File

@ -398,7 +398,7 @@ public:
try {
m_lazy_what = detail::error_string(m_type.ptr(), m_value.ptr(), m_trace.ptr());
} catch (...) {
return "Unknown internal error occurred";
m_lazy_what = "Unknown internal error occurred";
}
}
return m_lazy_what.c_str();