mirror of
https://github.com/python/cpython.git
synced 2025-10-17 04:08:28 +00:00
merge 3.2
This commit is contained in:
commit
822c790527
1 changed files with 6 additions and 2 deletions
|
@ -12591,9 +12591,13 @@ unicode_maketrans(PyObject *null, PyObject *args)
|
||||||
y_data = PyUnicode_DATA(y);
|
y_data = PyUnicode_DATA(y);
|
||||||
for (i = 0; i < PyUnicode_GET_LENGTH(x); i++) {
|
for (i = 0; i < PyUnicode_GET_LENGTH(x); i++) {
|
||||||
key = PyLong_FromLong(PyUnicode_READ(x_kind, x_data, i));
|
key = PyLong_FromLong(PyUnicode_READ(x_kind, x_data, i));
|
||||||
value = PyLong_FromLong(PyUnicode_READ(y_kind, y_data, i));
|
if (!key)
|
||||||
if (!key || !value)
|
|
||||||
goto err;
|
goto err;
|
||||||
|
value = PyLong_FromLong(PyUnicode_READ(y_kind, y_data, i));
|
||||||
|
if (!value) {
|
||||||
|
Py_DECREF(key);
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
res = PyDict_SetItem(new, key, value);
|
res = PyDict_SetItem(new, key, value);
|
||||||
Py_DECREF(key);
|
Py_DECREF(key);
|
||||||
Py_DECREF(value);
|
Py_DECREF(value);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue