Skip to content

Commit 8ae8dd8

Browse files
committed
Add the correct exception HEAD for python 3
1 parent 23e7030 commit 8ae8dd8

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
@@ -408,11 +408,16 @@ struct nonsimple_values_and_holders {
408408

409409
/// The 'instance' type which needs to be standard layout (need to be able to use 'offsetof')
410410
struct instance {
411+
#if (PY_MAJOR_VERSION == 3)
412+
PyException_HEAD
413+
#else
411414
PyObject_HEAD
412415
// Necessary to support exceptions.
413416
PyObject *dict;
414417
PyObject *args;
415418
PyObject *message;
419+
#endif
420+
416421
/// Storage for pointers and holder; see simple_layout, below, for a description
417422
union {
418423
void *simple_value_holder[1 + instance_simple_holder_in_ptrs()];

0 commit comments

Comments
 (0)