File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -445,7 +445,7 @@ PYBIND11_NOINLINE internals &get_internals() {
445445 }
446446 }
447447
448- if (internals_pp) {
448+ if (internals_pp && *internals_pp ) {
449449 // We loaded builtins through python's builtins, which means that our `error_already_set`
450450 // and `builtin_exception` may be different local classes than the ones set up in the
451451 // initial exception translator, below, so add another for our local exception classes.
@@ -457,7 +457,9 @@ PYBIND11_NOINLINE internals &get_internals() {
457457 (*internals_pp)->registered_exception_translators .push_front (&translate_local_exception);
458458#endif
459459 } else {
460- internals_pp = new internals *();
460+ if (!internals_pp) {
461+ internals_pp = new internals *();
462+ }
461463 auto *&internals_ptr = *internals_pp;
462464 internals_ptr = new internals ();
463465#if defined(WITH_THREAD)
You can’t perform that action at this time.
0 commit comments