mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Fix a leak and a buglet discovered by Thomas.
Get rid of silly lambdas in the unit test suite. Add a TODO list to the unit test suite (TDD style).
This commit is contained in:
parent
5f6f27de4d
commit
e06b6b8ff5
2 changed files with 50 additions and 17 deletions
|
@ -130,7 +130,7 @@ bytes_init(PyBytesObject *self, PyObject *args, PyObject *kwds)
|
|||
/* Get the iterator */
|
||||
it = PyObject_GetIter(arg);
|
||||
if (it == NULL)
|
||||
return 0;
|
||||
return -1;
|
||||
iternext = *it->ob_type->tp_iternext;
|
||||
|
||||
/* Run the iterator to exhaustion */
|
||||
|
@ -151,6 +151,7 @@ bytes_init(PyBytesObject *self, PyObject *args, PyObject *kwds)
|
|||
|
||||
/* Interpret it as an int (__index__) */
|
||||
value = PyNumber_Index(item);
|
||||
Py_DECREF(item);
|
||||
if (value == -1 && PyErr_Occurred())
|
||||
goto error;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue