]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-132527: Added missing `w` typecode to array() error message (#132529)
authorChristian Veenhuis <124370897+ChVeen@users.noreply.github.com>
Fri, 25 Apr 2025 13:31:05 +0000 (15:31 +0200)
committerGitHub <noreply@github.com>
Fri, 25 Apr 2025 13:31:05 +0000 (16:31 +0300)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Misc/NEWS.d/next/Library/2025-04-14-23-00-00.gh-issue-132527.kTi8T7.rst [new file with mode: 0644]
Modules/arraymodule.c

diff --git a/Misc/NEWS.d/next/Library/2025-04-14-23-00-00.gh-issue-132527.kTi8T7.rst b/Misc/NEWS.d/next/Library/2025-04-14-23-00-00.gh-issue-132527.kTi8T7.rst
new file mode 100644 (file)
index 0000000..997cc2b
--- /dev/null
@@ -0,0 +1 @@
+Include the valid typecode 'w' in the error message when an invalid typecode is passed to :class:`array.array`.
index 16f757feca3342958421da1e4e9f0bbb8d91a813..401a3a7072b8460c01865bbb9fd81696d98e6af7 100644 (file)
@@ -2873,7 +2873,7 @@ array_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
         }
     }
     PyErr_SetString(PyExc_ValueError,
-        "bad typecode (must be b, B, u, h, H, i, I, l, L, q, Q, f or d)");
+        "bad typecode (must be b, B, u, w, h, H, i, I, l, L, q, Q, f or d)");
     return NULL;
 }