diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c index b7eaa97e41670d0..147d607fb226f04 100644 --- a/Modules/arraymodule.c +++ b/Modules/arraymodule.c @@ -2620,11 +2620,6 @@ 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 " @@ -2634,6 +2629,11 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds) } } + if (PySys_Audit("array.__new__", "CO", + c, initial ? initial : Py_None) < 0) { + return NULL; + } + if (initial && c != 'u') { if (PyUnicode_Check(initial)) { PyErr_Format(PyExc_TypeError, "cannot use a str to initialize "