Skip to content

Commit 418820a

Browse files
authored
Merge pull request #6341 from radarhere/imagedraw
Only import ImageFont in ImageDraw when necessary
2 parents b37f2d1 + e961774 commit 418820a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/PIL/ImageDraw.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
import math
3434
import numbers
3535

36-
from . import Image, ImageColor, ImageFont
36+
from . import Image, ImageColor
3737

3838
"""
3939
A simple 2D drawing interface for PIL images.
@@ -667,6 +667,8 @@ def textbbox(
667667

668668
if font is None:
669669
font = self.getfont()
670+
from . import ImageFont
671+
670672
if not isinstance(font, ImageFont.FreeTypeFont):
671673
raise ValueError("Only supported for TrueType fonts")
672674
mode = "RGBA" if embedded_color else self.fontmode

0 commit comments

Comments
 (0)