Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cb83599

Browse files
committed
Delete deprecated C++ methods PyBufferRegion_to_string and PyBufferRegion_to_string_argb
This commit removes two deprecated methods, PyBufferRegion_to_string and PyBufferRegion_to_string_argb, from src/_backend_agg_wrapper.cpp, deprecated since version 3.7. Signed-off-by: Issam Arabi <[email protected]>
1 parent 9caf6b3 commit cb83599

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

src/_backend_agg_wrapper.cpp

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -44,18 +44,6 @@ static void PyBufferRegion_dealloc(PyBufferRegion *self)
4444
Py_TYPE(self)->tp_free((PyObject *)self);
4545
}
4646

47-
static PyObject *PyBufferRegion_to_string(PyBufferRegion *self, PyObject *args)
48-
{
49-
char const* msg =
50-
"BufferRegion.to_string is deprecated since Matplotlib 3.7 and will "
51-
"be removed two minor releases later; use np.asarray(region) instead.";
52-
if (PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1)) {
53-
return NULL;
54-
}
55-
return PyBytes_FromStringAndSize((const char *)self->x->get_data(),
56-
(Py_ssize_t) self->x->get_height() * self->x->get_stride());
57-
}
58-
5947
/* TODO: This doesn't seem to be used internally. Remove? */
6048

6149
static PyObject *PyBufferRegion_set_x(PyBufferRegion *self, PyObject *args)
@@ -87,28 +75,6 @@ static PyObject *PyBufferRegion_get_extents(PyBufferRegion *self, PyObject *args
8775
return Py_BuildValue("IIII", rect.x1, rect.y1, rect.x2, rect.y2);
8876
}
8977

90-
static PyObject *PyBufferRegion_to_string_argb(PyBufferRegion *self, PyObject *args)
91-
{
92-
char const* msg =
93-
"BufferRegion.to_string_argb is deprecated since Matplotlib 3.7 and "
94-
"will be removed two minor releases later; use "
95-
"np.take(region, [2, 1, 0, 3], axis=2) instead.";
96-
if (PyErr_WarnEx(PyExc_DeprecationWarning, msg, 1)) {
97-
return NULL;
98-
}
99-
PyObject *bufobj;
100-
uint8_t *buf;
101-
Py_ssize_t height, stride;
102-
height = self->x->get_height();
103-
stride = self->x->get_stride();
104-
bufobj = PyBytes_FromStringAndSize(NULL, height * stride);
105-
buf = (uint8_t *)PyBytes_AS_STRING(bufobj);
106-
107-
CALL_CPP_CLEANUP("to_string_argb", (self->x->to_string_argb(buf)), Py_DECREF(bufobj));
108-
109-
return bufobj;
110-
}
111-
11278
int PyBufferRegion_get_buffer(PyBufferRegion *self, Py_buffer *buf, int flags)
11379
{
11480
Py_INCREF(self);

0 commit comments

Comments
 (0)