Commit 822c7905 authored by Benjamin Peterson's avatar Benjamin Peterson

merge 3.2

parents 97193c1a 53aa1d7c
...@@ -12591,9 +12591,13 @@ unicode_maketrans(PyObject *null, PyObject *args) ...@@ -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));
if (!key)
goto err;
value = PyLong_FromLong(PyUnicode_READ(y_kind, y_data, i)); value = PyLong_FromLong(PyUnicode_READ(y_kind, y_data, i));
if (!key || !value) if (!value) {
Py_DECREF(key);
goto err; 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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment