Update pybind11 to v2.4.2

v2.3.0 fixed GIL handling bugs, which means we need to explicitly stop
storing the Python logging callback before exiting, or the exit will
hang.
This commit is contained in:
Oliver Hamlet
2019-10-22 17:43:30 +01:00
parent 580bf87802
commit b52cd9bd6b
3 changed files with 12 additions and 3 deletions
+1 -1
View File
@@ -40,7 +40,7 @@ configure_file("${CMAKE_SOURCE_DIR}/python/setup.py" "${CMAKE_BINARY_DIR}/genera
# pybind11
#######################################
set(PYBIND11_VERSION "2.2.4")
set(PYBIND11_VERSION "2.4.2")
set(PYBIND11_URL "https://github.com/pybind/pybind11/archive/v${PYBIND11_VERSION}.tar.gz")
set(PYBIND11_DOWNLOAD_PATH "${EXTERNAL_PROJECTS_PATH}/pybind11-${PYBIND11_VERSION}.tar.gz")
set(PYBIND11_EXTRACTED_PATH "${EXTERNAL_PROJECTS_PATH}/pybind11-${PYBIND11_VERSION}")
+7
View File
@@ -159,6 +159,13 @@ void bindClasses(pybind11::module& module) {
void bindFunctions(pybind11::module& module) {
module.def("set_logging_callback", &SetLoggingCallback);
// Need to clear the stored logging callback when exiting, or Python will
// hang because the callback pointer is still stored by libloot.
auto atexit = pybind11::module::import("atexit");
atexit.attr("register")(pybind11::cpp_function([]() {
SetLoggingCallback(nullptr);
}));
module.def("is_compatible", &IsCompatible);
module.def("initialise_locale", &InitialiseLocale, arg("id") = "");
+4 -2
View File
@@ -34,10 +34,12 @@ class GameFixture(unittest.TestCase):
data_path = os.path.join(self.game_path, 'Data')
master_file = os.path.join(data_path, 'Oblivion.esm')
os.makedirs(data_path)
if not os.path.exists(data_path):
os.makedirs(data_path)
open(master_file, 'a').close()
os.makedirs(self.local_path)
if not os.path.exists(self.local_path):
os.makedirs(self.local_path)
def tearDown(self):
shutil.rmtree(self.game_path)