Use the FileExistsError exception.