mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-80480: Emit DeprecationWarning for array's 'u' type code (#95760)
This commit is contained in:
parent
3a314f7c3d
commit
cc879481e2
7 changed files with 48 additions and 10 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue