File tree 2 files changed +33
-0
lines changed
2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,33 @@ matrix:
106
106
- lld-7
107
107
- libc++-7-dev
108
108
- libc++abi-7-dev # Why is this necessary???
109
+ - os : linux
110
+ dist : xenial
111
+ env : PYTHON=3.8 CPP=17 GCC=7
112
+ name : Python 3.8, c++17, gcc 7 (w/o numpy/scipy) # TODO: update build name when the numpy/scipy wheels become available
113
+ addons :
114
+ apt :
115
+ sources :
116
+ - deadsnakes
117
+ - ubuntu-toolchain-r-test
118
+ packages :
119
+ - g++-7
120
+ - python3.8-dev
121
+ - python3.8-venv
122
+ # Currently there is no numpy/scipy wheels available for python3.8
123
+ # TODO: remove next before_install, install and script clause when the wheels become available
124
+ before_install :
125
+ - pyenv global $(pyenv whence 2to3) # activate all python versions
126
+ - PY_CMD=python3
127
+ - $PY_CMD -m pip install --user --upgrade pip wheel setuptools
128
+ install :
129
+ - $PY_CMD -m pip install --user --upgrade pytest
130
+ script :
131
+ - |
132
+ # Barebones build
133
+ cmake -DCMAKE_BUILD_TYPE=Debug -DPYBIND11_WERROR=ON -DDOWNLOAD_CATCH=ON -DPYTHON_EXECUTABLE=$(which $PY_CMD) .
134
+ make pytest -j 2
135
+ make cpptest -j 2
109
136
- os : osx
110
137
name : Python 2.7, c++14, AppleClang 7.3, CMake test
111
138
osx_image : xcode7.3
Original file line number Diff line number Diff line change @@ -350,13 +350,19 @@ extern "C" inline void pybind11_object_dealloc(PyObject *self) {
350
350
auto type = Py_TYPE (self);
351
351
type->tp_free (self);
352
352
353
+ #if PY_VERSION_HEX < 0x03080000
353
354
// `type->tp_dealloc != pybind11_object_dealloc` means that we're being called
354
355
// as part of a derived type's dealloc, in which case we're not allowed to decref
355
356
// the type here. For cross-module compatibility, we shouldn't compare directly
356
357
// with `pybind11_object_dealloc`, but with the common one stashed in internals.
357
358
auto pybind11_object_type = (PyTypeObject *) get_internals ().instance_base ;
358
359
if (type->tp_dealloc == pybind11_object_type->tp_dealloc )
359
360
Py_DECREF (type);
361
+ #else
362
+ // This was not needed before Python 3.8 (Python issue 35810)
363
+ // https://github.com/pybind/pybind11/issues/1946
364
+ Py_DECREF (type);
365
+ #endif
360
366
}
361
367
362
368
/* * Create the type which can be used as a common base for all classes. This is
You can’t perform that action at this time.
0 commit comments