Skip to content

Commit 137fd6d

Browse files
committed
BUG: 'saving' context manager now passes all args, kw to setup.
This is the functionality added to master in 6bac790 (matplotlib#6304). Directly cherry-picking that is not possible because of the intervening introduction of abstract base classes.
1 parent dd589b3 commit 137fd6d

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
@@ -169,7 +169,7 @@ def frame_size(self):
169169
width_inches, height_inches = self.fig.get_size_inches()
170170
return width_inches * self.dpi, height_inches * self.dpi
171171

172-
def setup(self, fig, outfile, dpi, *args):
172+
def setup(self, fig, outfile, dpi):
173173
'''
174174
Perform setup for writing the movie file.
175175
@@ -190,14 +190,14 @@ def setup(self, fig, outfile, dpi, *args):
190190
self._run()
191191

192192
@contextlib.contextmanager
193-
def saving(self, *args):
193+
def saving(self, *args, **kw):
194194
'''
195195
Context manager to facilitate writing the movie file.
196196
197-
``*args`` are any parameters that should be passed to `setup`.
197+
``*args, **kw`` are any parameters that should be passed to `setup`.
198198
'''
199199
# This particular sequence is what contextlib.contextmanager wants
200-
self.setup(*args)
200+
self.setup(*args, **kw)
201201
yield
202202
self.finish()
203203

0 commit comments

Comments
 (0)