Skip to content

Commit ae8757c

Browse files
committed
Add the correct exception HEAD for python 3
1 parent a52634a commit ae8757c

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

445445
/// The 'instance' type which needs to be standard layout (need to be able to use 'offsetof')
446446
struct instance {
447+
#if (PY_MAJOR_VERSION == 3)
448+
PyException_HEAD
449+
#else
447450
PyObject_HEAD
448451
// Necessary to support exceptions.
449452
PyObject *dict;
450453
PyObject *args;
451454
PyObject *message;
455+
#endif
456+
452457
/// Storage for pointers and holder; see simple_layout, below, for a description
453458
union {
454459
void *simple_value_holder[1 + instance_simple_holder_in_ptrs()];

0 commit comments

Comments
 (0)