]> granicus.if.org Git - python/commit
Undo needless INCREF chicanery introduced by SF patch #450702.
authorJeremy Hylton <jeremy@alum.mit.edu>
Tue, 16 Oct 2001 23:26:08 +0000 (23:26 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Tue, 16 Oct 2001 23:26:08 +0000 (23:26 +0000)
commitba3dd9990fecb9b397169d254eb6dab6af8c86ec
tree1b4c2657be935ec4638456aea503231d4b65e22a
parent9d620d018c64affba26debf4397cb86c6767714e
Undo needless INCREF chicanery introduced by SF patch #450702.

    Apparently this patch (rev 2.41) replaced all the good old "s#"
    formats in PyArg_ParseTuple() with "S".  Then it did
    PyString_FromStringAndSize() to get back the values setup by the
    "s#" format.  It also incref'd and decref'd the string obtained by
    "S" even though the argument tuple had a reference to it.

Replace PyString_AsString() calls with PyString_AS_STRING().

    A good rule of thumb -- if you never check the return value of
    PyString_AsString() to see if it's NULL, you ought to be using the
    macro <wink>.
Modules/zlibmodule.c