Skip to content

Commit 07fae16

Browse files
committed
cleanup old workaround.
1 parent bd30188 commit 07fae16

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

include/pybind11/detail/internals.h

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -242,16 +242,6 @@ inline void translate_exception(std::exception_ptr p) {
242242
}
243243
}
244244

245-
#if !defined(__GLIBCXX__)
246-
inline void translate_local_exception(std::exception_ptr p) {
247-
try {
248-
if (p) std::rethrow_exception(p);
249-
} catch (error_already_set &e) { e.restore(); return;
250-
} catch (const builtin_exception &e) { e.set_error(); return;
251-
}
252-
}
253-
#endif
254-
255245
/// Return a reference to the current `internals` data
256246
PYBIND11_NOINLINE inline internals &get_internals() {
257247
auto **&internals_pp = get_internals_pp();
@@ -270,15 +260,6 @@ PYBIND11_NOINLINE inline internals &get_internals() {
270260
auto builtins = handle(PyEval_GetBuiltins());
271261
if (builtins.contains(id) && isinstance<capsule>(builtins[id])) {
272262
internals_pp = static_cast<internals **>(capsule(builtins[id]));
273-
274-
// We loaded builtins through python's builtins, which means that our `error_already_set`
275-
// and `builtin_exception` may be different local classes than the ones set up in the
276-
// initial exception translator, below, so add another for our local exception classes.
277-
//
278-
// libstdc++ doesn't require this (types there are identified only by name)
279-
#if !defined(__GLIBCXX__)
280-
(*internals_pp)->registered_exception_translators.push_front(&translate_local_exception);
281-
#endif
282263
} else {
283264
if (!internals_pp) internals_pp = new internals*();
284265
auto *&internals_ptr = *internals_pp;

0 commit comments

Comments
 (0)