| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + Passing `bytes` to ``FT2Font.set_text`` | ||
| 2 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 3 | + ... is deprecated, pass `str` instead. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -648,6 +648,13 @@ static PyObject *PyFT2Font_set_text(PyFT2Font *self, PyObject *args, PyObject *k | |||
| 648 | 648 | } | |
| 649 | 649 | #endif | |
| 650 | 650 | } else if (PyBytes_Check(textobj)) { | |
| 651 | + if (PyErr_WarnEx( | ||
| 652 | + PyExc_FutureWarning, | ||
| 653 | + "Passing bytes to FTFont.set_text is deprecated since Matplotlib " | ||
| 654 | + "3.4 and support will be removed in Matplotlib 3.6; pass str instead", | ||
| 655 | + 1)) { | ||
| 656 | + return NULL; | ||
| 657 | + } | ||
| 651 | 658 | size = PyBytes_Size(textobj); | |
| 652 | 659 | codepoints.resize(size); | |
| 653 | 660 | char *bytestr = PyBytes_AsString(textobj); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments