Skip to content

Commit 97cedd2

Browse files
committed
Add the correct exception HEAD for python 3
1 parent 64b21d6 commit 97cedd2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

include/pybind11/detail/common.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,11 +415,16 @@ struct nonsimple_values_and_holders {
415415

416416
/// The 'instance' type which needs to be standard layout (need to be able to use 'offsetof')
417417
struct instance {
418+
#if (PY_MAJOR_VERSION == 3)
419+
PyException_HEAD
420+
#else
418421
PyObject_HEAD
419422
// Necessary to support exceptions.
420423
PyObject *dict;
421424
PyObject *args;
422425
PyObject *message;
426+
#endif
427+
423428
/// Storage for pointers and holder; see simple_layout, below, for a description
424429
union {
425430
void *simple_value_holder[1 + instance_simple_holder_in_ptrs()];

0 commit comments

Comments
 (0)