Skip to content

Commit

Permalink
Fix misleading error message in multiprocesing module
Browse files Browse the repository at this point in the history
  • Loading branch information
nanjekyejoannah committed Oct 11, 2023
1 parent f27b830 commit 04110ad
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Lib/test/test_ctypes/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ def test_c_char(self):
with self.assertRaises(TypeError) as cm:
c_char.from_param(b"abc")
self.assertEqual(str(cm.exception),
"one character bytes, bytearray or integer expected")
"character bytes, bytearray or integer expected")

def test_c_wchar(self):
with self.assertRaises(TypeError) as cm:
c_wchar.from_param("abc")
self.assertEqual(str(cm.exception),
"one character unicode string expected")
"character unicode string expected")


with self.assertRaises(TypeError) as cm:
Expand Down
4 changes: 2 additions & 2 deletions Modules/_ctypes/cfield.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ c_set(void *ptr, PyObject *value, Py_ssize_t size)
}
error:
PyErr_Format(PyExc_TypeError,
"one character bytes, bytearray or integer expected");
"character bytes, bytearray or integer expected");
return NULL;
}

Expand Down Expand Up @@ -1133,7 +1133,7 @@ u_set(void *ptr, PyObject *value, Py_ssize_t size)
if (len != 1) {
Py_DECREF(value);
PyErr_SetString(PyExc_TypeError,
"one character unicode string expected");
"character unicode string expected");
return NULL;
}

Expand Down

0 comments on commit 04110ad

Please sign in to comment.