[Python-Dev] RE: [Python-checkins] python/dist/src/Modules heapqmodule.c, 1.1, 1.2 (original) (raw)
Tim Peters tim.one at comcast.net
Sat Nov 15 07:41:44 EST 2003
- Previous message: [Python-Dev] Small bug -- direct check-in allowed?
- Next message: list.sort, was Re: [Python-Dev] decorate-sort-undecorate
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Modified Files: heapqmodule.c Log Message: Verify heappop argument is a list.
Index: heapqmodule.c =================================================================== RCS file: /cvsroot/python/python/dist/src/Modules/heapqmodule.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** heapqmodule.c 8 Nov 2003 10:24:38 -0000 1.1 --- heapqmodule.c 15 Nov 2003 12:33:01 -0000 1.2 *************** *** 120,123 **** --- 120,128 ---- int n; + if (!PyListCheck(heap)) { + PyErrSetString(PyExcValueError, "heap argument must be a list"); + return NULL; + }
Now that's controversial: the complaint is about the type of the argument so should raise TypeError instead. Curiously, the Python version of this module raised a pretty mysterious AttributeError.
- Previous message: [Python-Dev] Small bug -- direct check-in allowed?
- Next message: list.sort, was Re: [Python-Dev] decorate-sort-undecorate
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]