summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorHugo van Kemenade <hugovk@users.noreply.github.com>2023-06-11 09:17:35 (GMT)
committerGitHub <noreply@github.com>2023-06-11 09:17:35 (GMT)
commitcc879481e2ac29742ce191f4c6ed4bd85e5e11ba (patch)
treeec351755d6df819ba80a6530dd822d16972c809a /Modules
parent3a314f7c3df0dd7c37da7d12b827f169ee60e1ea (diff)
downloadcpython-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.c9
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) {