Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5e5999f

Browse files
committed
MNT: Add original exception to raised IOError.
1 parent ecfc1e7 commit 5e5999f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/matplotlib/animation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -234,14 +234,14 @@ def grab_frame(self, **savefig_kwargs):
234234
# frame format and dpi.
235235
self.fig.savefig(self._frame_sink(), format=self.frame_format,
236236
dpi=self.dpi, **savefig_kwargs)
237-
except (RuntimeError, IOError):
237+
except (RuntimeError, IOError) as e:
238238
out, err = self._proc.communicate()
239239
verbose.report('MovieWriter -- Error '
240240
'running proc:\n%s\n%s' % (out,
241241
err), level='helpful')
242-
raise IOError('Error saving animation to file. '
243-
'Stdout: {0} StdError: {1}. It may help to re-run '
244-
'with --verbose-debug.'.format(out, err))
242+
raise IOError('Error saving animation to file (cause: {0}) '
243+
'Stdout: {1} StdError: {2}. It may help to re-run '
244+
'with --verbose-debug.'.format(e, out, err))
245245

246246
def _frame_sink(self):
247247
'Returns the place to which frames should be written.'

0 commit comments

Comments
 (0)