]> granicus.if.org Git - python/commitdiff
Strengthen the guard. The code doesn't work well with subclasses.
authorRaymond Hettinger <python@rcn.com>
Fri, 29 May 2009 22:11:22 +0000 (22:11 +0000)
committerRaymond Hettinger <python@rcn.com>
Fri, 29 May 2009 22:11:22 +0000 (22:11 +0000)
Objects/unicodeobject.c

index 47e0933174aacc1e3ee4a791372e355002a047d0..7cc7037a80639ec1f0ed2d0047532d6ff7136a58 100644 (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;