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:
Guido van Rossum 2006-04-23 07:43:54 +00:00
parent 5f6f27de4d
commit e06b6b8ff5
2 changed files with 50 additions and 17 deletions

View file

@ -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;