From 48b0819cdad1a9cba2aae0718ec2c8ed06f1e9d8 Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 1 Sep 2022 19:41:37 +0200 Subject: [PATCH] rocket: Don't try to build Boost binding code for Python 3 libRocket doesn't support Python 3 anyway, and it has an error compiling with Python 3.11 [skip ci] --- doc/ReleaseNotes | 1 + panda/src/rocket/rocketRegion_ext.cxx | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/ReleaseNotes b/doc/ReleaseNotes index 1314ad901f..fa0afb6e20 100644 --- a/doc/ReleaseNotes +++ b/doc/ReleaseNotes @@ -42,6 +42,7 @@ Miscellaneous * Add additional helpful debug/spam prints to display code Build +* Support building with Python 3.11 * Support building with OpenSSL 1.1.1 on Windows * Support building with OpenEXR 3.0 or 3.1 on Windows * Fix errors when compiling Panda headers with MinGW diff --git a/panda/src/rocket/rocketRegion_ext.cxx b/panda/src/rocket/rocketRegion_ext.cxx index 84acb44aa0..f7ff0e6519 100644 --- a/panda/src/rocket/rocketRegion_ext.cxx +++ b/panda/src/rocket/rocketRegion_ext.cxx @@ -16,7 +16,7 @@ #ifdef HAVE_PYTHON -#ifndef CPPPARSER +#if !defined(CPPPARSER) && PY_MAJOR_VERSION < 3 #define HAVE_LONG_LONG 1 #include #include @@ -30,6 +30,7 @@ */ PyObject* Extension:: get_context() const { +#if PY_MAJOR_VERSION < 3 try { Rocket::Core::Context* context = _this->get_context(); python::object py_context = Rocket::Core::Python::Utilities::MakeObject(context); @@ -44,6 +45,7 @@ get_context() const { (void)e; // Return NULL, which will trigger the exception in Python } +#endif return nullptr; }