(self)
Make sure that self.file_obj gets closed/deleted.
Make sure that self.file_obj gets closed/deleted.
Make sure that self . file_obj gets closed / deleted .
def __del__(self):
        """
        Make sure that self.file_obj gets closed/deleted.
        """
        logging.debug("FileType __del__(): Closing/deleting temp file(s)")
        try:
            self.file_obj.close() # Ensures it gets deleted
        except AttributeError:
            pass # Probably never got opened properly (bad file); no big
        try:
            self.original_file.close()
        except AttributeError:
            pass
def __del__ ( self ) : logging . debug ( "FileType __del__(): Closing/deleting temp file(s)" ) try : self . file_obj . close ( ) # Ensures it gets deleted except AttributeError : pass # Probably never got opened properly (bad file); no big try : self . original_file . close ( ) except AttributeError : pass