def METHOD_NAME(self):
    if self.f is not None:
        self.f.close()
    if self.fout is not None:
        try:
            self.fout.close()
        except (aifc.Error, AttributeError):
            pass
    try:
        os.remove(TESTFN)
    except OSError:
        pass