diff options
author | Hugo van Kemenade <hugovk@users.noreply.github.com> | 2023-06-11 09:17:35 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-11 09:17:35 (GMT) |
commit | cc879481e2ac29742ce191f4c6ed4bd85e5e11ba (patch) | |
tree | ec351755d6df819ba80a6530dd822d16972c809a /Modules | |
parent | 3a314f7c3df0dd7c37da7d12b827f169ee60e1ea (diff) | |
download | cpython-cc879481e2ac29742ce191f4c6ed4bd85e5e11ba.zip cpython-cc879481e2ac29742ce191f4c6ed4bd85e5e11ba.tar.gz cpython-cc879481e2ac29742ce191f4c6ed4bd85e5e11ba.tar.bz2 |
gh-80480: Emit DeprecationWarning for array's 'u' type code (#95760)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/arraymodule.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index 16e3739..1a59938 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -2679,6 +2679,15 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds) return NULL; } + if (c == 'u') { + if (PyErr_WarnEx(PyExc_DeprecationWarning, + "The 'u' type code is deprecated and " + "will be removed in Python 3.16", + 1)) { + return NULL; + } + } + bool is_unicode = c == 'u' || c == 'w'; if (initial && !is_unicode) { |