From: Raymond Hettinger Date: Fri, 29 May 2009 22:11:22 +0000 (+0000) Subject: Strengthen the guard. The code doesn't work well with subclasses. X-Git-Tag: v3.1rc1~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ad05763a6d69a93e58dfef6cc9d84f14edbb29b;p=python Strengthen the guard. The code doesn't work well with subclasses. --- diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 47e0933174..7cc7037a80 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -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;