On Aug 24, 2004, at 1:20 PM, Eric Schwartz wrote: > Charles Mills <cmills / freeshell.org> writes: >> I am unittesting a C extension. The extension opens files using >> open(). I want to make sure that the extension closes all the files >> it >> opens (when errors occur or whatever). > > Call me crazy, but what's wrong with adding each file descriptor you > open into a list, and then traversing that list at error time (or > whatever) to make sure they're all closed? That is a good idea. :) -Charlie