Skip to content

Commit 64a6a1c

Browse files
Split
1 parent 69b8521 commit 64a6a1c

3 files changed

Lines changed: 2 additions & 9 deletions

File tree

Lib/test/test_str.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -454,13 +454,6 @@ def test_maketrans_translate(self):
454454
self.assertEqual("[a\xe9]".translate(str.maketrans({'a': '<\u20ac>'})),
455455
"[<\u20ac>\xe9]")
456456

457-
# with frozendict
458-
tbl = self.type2test.maketrans(frozendict({'s': 'S', 'T': 't'}))
459-
self.assertEqual(tbl, {ord('s'): 'S', ord('T'): 't'})
460-
self.assertEqual('sTan'.translate(tbl), 'Stan')
461-
tbl = self.type2test.maketrans(frozendict({'a': None, 'b': '<i>'}))
462-
self.checkequalnofix('<i><i><i>c', 'abababc', 'translate', tbl)
463-
464457
# invalid Unicode characters
465458
invalid_char = 0x10ffff+1
466459
for before in "a\xe9\u20ac\U0010ffff":
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
:meth:`str.maketrans` and :func:`type` now accept :class:`frozendict`.
1+
:func:`type` now accepts :class:`frozendict` as an argument.

Objects/unicodeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13149,7 +13149,7 @@ unicode_maketrans_impl(PyObject *x, PyObject *y, PyObject *z)
1314913149
const void *data;
1315013150

1315113151
/* x must be a dict */
13152-
if (!PyAnyDict_CheckExact(x)) {
13152+
if (!PyDict_CheckExact(x)) {
1315313153
PyErr_SetString(PyExc_TypeError, "if you give only one argument "
1315413154
"to maketrans it must be a dict");
1315513155
goto err;

0 commit comments

Comments
 (0)