mirror of
https://github.com/python/cpython.git
synced 2025-07-15 23:35:23 +00:00
Strengthen the guard. The code doesn't work well with subclasses.
This commit is contained in:
parent
f17ab89c77
commit
3ad05763a6
1 changed files with 1 additions and 1 deletions
|
@ -8547,7 +8547,7 @@ unicode_maketrans(PyUnicodeObject *null, PyObject *args)
|
|||
}
|
||||
} else {
|
||||
/* x must be a dict */
|
||||
if (!PyDict_Check(x)) {
|
||||
if (!PyDict_CheckExact(x)) {
|
||||
PyErr_SetString(PyExc_TypeError, "if you give only one argument "
|
||||
"to maketrans it must be a dict");
|
||||
goto err;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue