From 6bf45cdcfdb2ed789e5fbcfc453c148df4d66e84 Mon Sep 17 00:00:00 2001 From: Greg Lucas Date: Thu, 10 Oct 2024 08:42:40 -0600 Subject: [PATCH] FIX macos: Use the agg buffer_rgba rather than private attribute The _renderer attribute has changed with the pybind11 update and we aren't able to access it as a buffer anymore. We can use the buffer_rgba method to get the direct memoryview of the buffer instead. --- src/_macosx.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/_macosx.m b/src/_macosx.m index fda928536ab5..09838eccaf98 100755 --- a/src/_macosx.m +++ b/src/_macosx.m @@ -1236,7 +1236,7 @@ -(void)drawRect:(NSRect)rect CGContextRef cr = [[NSGraphicsContext currentContext] CGContext]; if (!(renderer = PyObject_CallMethod(canvas, "get_renderer", "")) - || !(renderer_buffer = PyObject_GetAttrString(renderer, "_renderer"))) { + || !(renderer_buffer = PyObject_CallMethod(renderer, "buffer_rgba", ""))) { PyErr_Print(); goto exit; }