Kaydet (Commit) e7f2186f authored tarafından Chris Jerdonek's avatar Chris Jerdonek

Issue #16495: remove extraneous NULL encoding check from bytes_decode().

The NULL encoding check in bytes_decode() was unnecessary because this case
is already taken care of by the call to _Py_normalize_encoding() inside
PyUnicode_Decode().
üst 527507d7
......@@ -10,6 +10,8 @@ What's New in Python 3.4.0 Alpha 1?
Core and Builtins
-----------------
- Issue #16495: Remove extraneous NULL encoding check from bytes_decode().
- Issue #16619: Create NameConstant AST class to represent None, True, and False
literals. As a result, these constants are never loaded at runtime from
builtins.
......
......@@ -2236,8 +2236,6 @@ bytes_decode(PyObject *self, PyObject *args, PyObject *kwargs)
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "|ss:decode", kwlist, &encoding, &errors))
return NULL;
if (encoding == NULL)
encoding = PyUnicode_GetDefaultEncoding();
return PyUnicode_FromEncodedObject(self, encoding, errors);
}
......
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