def testStatusDoesNotLeak(self): try: _pywrap_file_io.DeleteFile(compat.as_bytes("/DOES_NOT_EXIST/")) except: pass gc.collect() self.assertEqual(0, self._CountReferences(c_api_util.ScopedTFStatus))
def delete_file_v2(path): """Deletes the path located at 'path'. Args: path: string, a path Raises: errors.OpError: Propagates any errors reported by the FileSystem API. E.g., `NotFoundError` if the path does not exist. """ _pywrap_file_io.DeleteFile(compat.path_to_bytes(path))