@@ -1972,8 +1972,8 @@ def _switch_canvas_and_return_print_method(self, fmt, backend=None):
19721972 """
19731973 Context manager temporarily setting the canvas for saving the figure::
19741974
1975- with canvas._switch_canvas_and_return_print_method(fmt, backend) \\
1976- as print_method:
1975+ with ( canvas._switch_canvas_and_return_print_method(fmt, backend)
1976+ as print_method) :
19771977 # ``print_method`` is a suitable ``print_{fmt}`` method, and
19781978 # the figure's canvas is temporarily switched to the method's
19791979 # canvas within the with... block. ``print_method`` is also
@@ -2110,13 +2110,13 @@ def print_figure(
21102110 "'figure', or omit the *papertype* argument entirely." )
21112111
21122112 # Remove the figure manager, if any, to avoid resizing the GUI widget.
2113- with cbook ._setattr_cm (self , manager = None ), \
2114- self ._switch_canvas_and_return_print_method (format , backend ) \
2115- as print_method , \
2116- cbook ._setattr_cm (self .figure , dpi = dpi ), \
2117- cbook ._setattr_cm (self .figure .canvas , _device_pixel_ratio = 1 ), \
2118- cbook ._setattr_cm (self .figure .canvas , _is_saving = True ), \
2119- ExitStack () as stack :
2113+ with ( cbook ._setattr_cm (self , manager = None ),
2114+ self ._switch_canvas_and_return_print_method (format , backend )
2115+ as print_method ,
2116+ cbook ._setattr_cm (self .figure , dpi = dpi ),
2117+ cbook ._setattr_cm (self .figure .canvas , _device_pixel_ratio = 1 ),
2118+ cbook ._setattr_cm (self .figure .canvas , _is_saving = True ),
2119+ ExitStack () as stack ) :
21202120
21212121 for prop in ["facecolor" , "edgecolor" ]:
21222122 color = locals ()[prop ]
0 commit comments