mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-11 08:03:55 +00:00
Show ODR VIOLATION DETECTED message only if PYBIND11_DETAIL_TYPE_CASTER_ODR_GUARD_IMPL_DEBUG
is defined, to not clutter the test_gil_scoped.py output with many of these messages when multiprocessing.set_start_method("forkserver")
is used.
This commit is contained in:
parent
13eb5eafd5
commit
33fb7a6bd8
@ -82,8 +82,10 @@ inline void type_caster_odr_guard_impl(const std::type_info &intrinsic_type_info
|
||||
+ reg_iter->second + "\", SourceLocation2=\"" + source_file_line_from_sloc
|
||||
+ "\"");
|
||||
if (throw_disabled) {
|
||||
# if defined(PYBIND11_DETAIL_TYPE_CASTER_ODR_GUARD_IMPL_DEBUG)
|
||||
std::fprintf(stderr, "\nDISABLED std::system_error: %s\n", msg.c_str());
|
||||
std::fflush(stderr);
|
||||
# endif
|
||||
type_caster_odr_violation_detected_counter()++;
|
||||
} else {
|
||||
throw std::system_error(std::make_error_code(std::errc::state_not_recoverable), msg);
|
||||
|
Loading…
Reference in New Issue
Block a user