From 3ad05763a6d69a93e58dfef6cc9d84f14edbb29b Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Fri, 29 May 2009 22:11:22 +0000 Subject: Strengthen the guard. The code doesn't work well with subclasses. --- Objects/unicodeobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 47e0933..7cc7037 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; -- cgit v0.12