Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move warning after audit
  • Loading branch information
hugovk committed Jun 6, 2023
commit e3b96bb6eec9bbc6f4c8cfda012decdcd0380795
10 changes: 5 additions & 5 deletions Modules/arraymodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -2674,6 +2674,11 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
if (!PyArg_ParseTuple(args, "C|O:array", &c, &initial))
return NULL;

if (PySys_Audit("array.__new__", "CO",
c, initial ? initial : Py_None) < 0) {
return NULL;
}

if (c == 'u') {
if (PyErr_WarnEx(PyExc_DeprecationWarning,
"The 'u' type code is deprecated and "
Expand All @@ -2683,11 +2688,6 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
}
}

if (PySys_Audit("array.__new__", "CO",
c, initial ? initial : Py_None) < 0) {
return NULL;
}

bool is_unicode = c == 'u' || c == 'w';

if (initial && !is_unicode) {
Expand Down