Commits

Anonymous committed 1a521c0

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

  • Participants
  • Parent commits 6d4c47f

Comments (0)

Files changed (1)

File Objects/unicodeobject.c

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