# only set the 'formats' fields if the original info_dict list them
# otherwise we end up with a circular reference, the first (and unique)
# element in the 'formats' field in info_dict is info_dict itself,
# only set the 'formats' fields if the original info_dict list them
# otherwise we end up with a circular reference, the first (and unique)
# element in the 'formats' field in info_dict is info_dict itself,
info_dict['formats'] = formats
if self.params.get('listformats'):
self.list_formats(info_dict)
info_dict['formats'] = formats
if self.params.get('listformats'):
self.list_formats(info_dict)