Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3ad0576

Browse files
committed
Strengthen the guard. The code doesn't work well with subclasses.
1 parent f17ab89 commit 3ad0576

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8547,7 +8547,7 @@ unicode_maketrans(PyUnicodeObject *null, PyObject *args)
85478547
}
85488548
} else {
85498549
/* x must be a dict */
8550-
if (!PyDict_Check(x)) {
8550+
if (!PyDict_CheckExact(x)) {
85518551
PyErr_SetString(PyExc_TypeError, "if you give only one argument "
85528552
"to maketrans it must be a dict");
85538553
goto err;

0 commit comments

Comments
 (0)