Strengthen the guard. The code doesn't work well with subclasses.

This commit is contained in:
Raymond Hettinger 2009-05-29 22:11:22 +00:00
parent f17ab89c77
commit 3ad05763a6

View file

@ -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;