Commit a60612ae authored by Tiago Peixoto's avatar Tiago Peixoto

Fix compilation issue with Python 2

parent e5ba44c7
Pipeline #415 passed with stage
in 418 minutes and 9 seconds
......@@ -15,16 +15,24 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifdef HAVE_CAIROMM
#include "graph.hh"
#ifdef HAVE_CAIROMM
#include PYCAIRO_HEADER
#if PY_MAJOR_VERSION < 3
static Pycairo_CAPI_t *Pycairo_CAPI = nullptr;
#endif
extern "C"
PyObject* gt_PycairoContext_FromContext(cairo_t *ctx, PyTypeObject *type,
PyObject *base)
{
#if PY_MAJOR_VERSION < 3
if (Pycairo_CAPI == nullptr)
Pycairo_IMPORT;
#endif
return PycairoContext_FromContext(ctx, type, base);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment