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

Skip to content

Commit 9d9c763

Browse files
committed
Remove outdated Py_TPFLAGS_HAVE_NEWBUFFER flag.
Python 3 always uses the new buffer protocol.
1 parent 44bead1 commit 9d9c763

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

src/_backend_agg_wrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ static PyTypeObject *PyBufferRegion_init_type(PyObject *m, PyTypeObject *type)
134134
type->tp_name = "matplotlib.backends._backend_agg.BufferRegion";
135135
type->tp_basicsize = sizeof(PyBufferRegion);
136136
type->tp_dealloc = (destructor)PyBufferRegion_dealloc;
137-
type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_NEWBUFFER;
137+
type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE;
138138
type->tp_methods = methods;
139139
type->tp_new = PyBufferRegion_new;
140140
type->tp_as_buffer = &buffer_procs;
@@ -700,7 +700,7 @@ static PyTypeObject *PyRendererAgg_init_type(PyObject *m, PyTypeObject *type)
700700
type->tp_name = "matplotlib.backends._backend_agg.RendererAgg";
701701
type->tp_basicsize = sizeof(PyRendererAgg);
702702
type->tp_dealloc = (destructor)PyRendererAgg_dealloc;
703-
type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_NEWBUFFER;
703+
type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE;
704704
type->tp_methods = methods;
705705
type->tp_init = (initproc)PyRendererAgg_init;
706706
type->tp_new = PyRendererAgg_new;

src/ft2font_wrapper.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static PyTypeObject *PyFT2Image_init_type(PyObject *m, PyTypeObject *type)
207207
type->tp_name = "matplotlib.ft2font.FT2Image";
208208
type->tp_basicsize = sizeof(PyFT2Image);
209209
type->tp_dealloc = (destructor)PyFT2Image_dealloc;
210-
type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_NEWBUFFER;
210+
type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE;
211211
type->tp_methods = methods;
212212
type->tp_new = PyFT2Image_new;
213213
type->tp_init = (initproc)PyFT2Image_init;
@@ -1656,7 +1656,7 @@ static PyTypeObject *PyFT2Font_init_type(PyObject *m, PyTypeObject *type)
16561656
type->tp_doc = PyFT2Font_init__doc__;
16571657
type->tp_basicsize = sizeof(PyFT2Font);
16581658
type->tp_dealloc = (destructor)PyFT2Font_dealloc;
1659-
type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_NEWBUFFER;
1659+
type->tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE;
16601660
type->tp_methods = methods;
16611661
type->tp_getset = getset;
16621662
type->tp_new = PyFT2Font_new;

src/mplutils.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ typedef unsigned __int8 uint8_t;
3030

3131
#include <Python.h>
3232

33-
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
34-
3533
#undef CLAMP
3634
#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
3735

0 commit comments

Comments
 (0)