From cf3178cd6f9b56d848db5c6d5da413a6dc17aa8c 2014-02-21 06:09:37 From: MinRK Date: 2014-02-21 06:09:37 Subject: [PATCH] generate supported formats in ValueError --- diff --git a/IPython/core/pylabtools.py b/IPython/core/pylabtools.py index 938363c..01a0fb0 100644 --- a/IPython/core/pylabtools.py +++ b/IPython/core/pylabtools.py @@ -206,8 +206,9 @@ def select_figure_formats(shell, formats, **kwargs): supported = {'png', 'png2x', 'retina', 'jpg', 'jpeg', 'svg', 'pdf'} bad = formats.difference(supported) if bad: - s = "{%s}" % ",".join([repr(f) for f in bad]) - raise ValueError("supported formats are: 'png', 'retina', 'svg', 'jpg', 'pdf' not %s" % s) + bs = "%s" % ','.join([repr(f) for f in bad]) + gs = "%s" % ','.join([repr(f) for f in supported]) + raise ValueError("supported formats are: %s not %s" % (gs, bs)) if 'png' in formats: png_formatter.for_type(Figure, lambda fig: print_figure(fig, 'png', **kwargs))