Skip to content

Commit 4235cd4

Browse files
committed
fix ValueError message
1 parent cf90fba commit 4235cd4

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

plotly/offline/offline.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -295,12 +295,8 @@ def iplot(figure_or_data, show_link=True, link_text='Export to plot.ly',
295295

296296
if image:
297297
if image not in __IMAGE_FORMATS:
298-
img_n = len(__IMAGE_FORMATS)
299-
raise ValueError('The image parameter takes only the '
300-
'following format types: `{}`, `{}`, '
301-
'`{}`, `{}`'.format(*[__IMAGE_FORMATS[i]
302-
for i in range(img_n)]
303-
)
298+
raise ValueError('The image parameter must be one of the following'
299+
': {}'.format(__IMAGE_FORMATS)
304300
)
305301
# if image is given, and is a valid format, we will download the image
306302
script = get_image_download_script('iplot').format(format=image,
@@ -417,12 +413,8 @@ def plot(figure_or_data,
417413

418414
if image:
419415
if image not in __IMAGE_FORMATS:
420-
img_n = len(__IMAGE_FORMATS)
421-
raise ValueError('The image parameter takes only the '
422-
'following format types: `{}`, `{}`, '
423-
'`{}`, `{}`'.format(*[__IMAGE_FORMATS[i]
424-
for i in range(img_n)]
425-
)
416+
raise ValueError('The image parameter must be one of the '
417+
'following: {}'.format(__IMAGE_FORMATS)
426418
)
427419
# if the check passes then download script is injected.
428420
# write the download script:

0 commit comments

Comments
 (0)