1111
1212#include " ../pytypes.h"
1313
14+ #include < exception>
15+
1416PYBIND11_NAMESPACE_BEGIN (PYBIND11_NAMESPACE)
1517PYBIND11_NAMESPACE_BEGIN(detail)
1618// Forward declarations
@@ -100,9 +102,7 @@ struct internals {
100102 std::unordered_set<std::pair<const PyObject *, const char *>, overload_hash> inactive_overload_cache;
101103 type_map<std::vector<bool (*)(PyObject *, void *&)>> direct_conversions;
102104 std::unordered_map<const PyObject *, std::vector<PyObject *>> patients;
103- #if !defined (__PGIC__)
104105 std::forward_list<void (*) (std::exception_ptr)> registered_exception_translators;
105- #endif
106106 std::unordered_map<std::string, void *> shared_data; // Custom data to be shared across extensions
107107 std::vector<PyObject *> loader_patient_stack; // Used by `loader_life_support`
108108 std::forward_list<std::string> static_strings; // Stores the std::strings backing detail::c_str()
@@ -214,7 +214,6 @@ inline internals **&get_internals_pp() {
214214 return internals_pp;
215215}
216216
217- #if !defined (__PGIC__)
218217inline void translate_exception (std::exception_ptr p) {
219218 try {
220219 if (p) std::rethrow_exception (p);
@@ -233,7 +232,6 @@ inline void translate_exception(std::exception_ptr p) {
233232 return ;
234233 }
235234}
236- #endif
237235
238236#if !defined(__GLIBCXX__)
239237inline void translate_local_exception (std::exception_ptr p) {
@@ -270,9 +268,7 @@ PYBIND11_NOINLINE inline internals &get_internals() {
270268 //
271269 // libstdc++ doesn't require this (types there are identified only by name)
272270#if !defined(__GLIBCXX__)
273- #if !defined (__PGIC__)
274271 (*internals_pp)->registered_exception_translators .push_front (&translate_local_exception);
275- #endif
276272#endif
277273 } else {
278274 if (!internals_pp) internals_pp = new internals*();
@@ -298,9 +294,7 @@ PYBIND11_NOINLINE inline internals &get_internals() {
298294 internals_ptr->istate = tstate->interp ;
299295#endif
300296 builtins[id] = capsule (internals_pp);
301- #if !defined (__PGIC__)
302297 internals_ptr->registered_exception_translators .push_front (&translate_exception);
303- #endif
304298 internals_ptr->static_property_type = make_static_property_type ();
305299 internals_ptr->default_metaclass = make_default_metaclass ();
306300 internals_ptr->instance_base = make_object_base_type (internals_ptr->default_metaclass );
0 commit comments