Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 0600ce6

Browse filesBrowse 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 <issam@cs.toronto.edu>
1 parent e1916bb commit 0600ce6
Copy full SHA for 0600ce6

File tree

Expand file treeCollapse file tree

1 file changed

+0
-34
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+0
-34
lines changed

‎src/_backend_agg_wrapper.cpp

Copy file name to clipboardExpand all lines: src/_backend_agg_wrapper.cpp
-34Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.