Skip to content

Commit d8d2c68

Browse files
committed
remove redundant if statement.
1 parent 9de19d0 commit d8d2c68

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

lib/matplotlib/artist.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ def _prevent_rasterization(draw):
2626
# its draw method is explicitly decorated). If it is being drawn after a
2727
# rasterized artist and it has reached a raster_depth of 0, we stop
2828
# rasterization so that it does not affect the behavior of normal artist
29-
# (e.g., change in dpi). If the artist's draw method is decorated (has a
30-
# `_supports_rasterization` attribute), it won't be decorated by
31-
# `_prevent_rasterization`.
32-
33-
if hasattr(draw, "_supports_rasterization"):
34-
return draw
29+
# (e.g., change in dpi).
3530

3631
@wraps(draw)
3732
def draw_wrapper(artist, renderer):
@@ -131,7 +126,9 @@ class Artist:
131126
def __init_subclass__(cls):
132127

133128
# Decorate draw() method so that all artists are able to stop
134-
# rastrization when necessary.
129+
# rastrization when necessary. If the artist's draw method is already
130+
# decorated (has a `_supports_rasterization` attribute), it won't be
131+
# decorated.
135132

136133
if not hasattr(cls.draw, "_supports_rasterization"):
137134
cls.draw = _prevent_rasterization(cls.draw)

0 commit comments

Comments
 (0)