mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-26 01:46:18 +03:00
None is also not a valid value
This commit is contained in:
parent
d088c804d0
commit
b4b8249c9d
|
@ -981,6 +981,9 @@ class TestImageFont:
|
|||
font = self.get_font()
|
||||
with pytest.warns(DeprecationWarning):
|
||||
font.getmask2("Hello world", fill=Image.core.fill)
|
||||
with pytest.raises(TypeError):
|
||||
with pytest.warns(DeprecationWarning):
|
||||
font.getmask2("Hello world", fill=None)
|
||||
|
||||
|
||||
@skip_unless_feature("raqm")
|
||||
|
|
|
@ -64,6 +64,9 @@ except ImportError:
|
|||
core = _imagingft_not_installed()
|
||||
|
||||
|
||||
_UNSPECIFIED = object()
|
||||
|
||||
|
||||
# FIXME: add support for pilfont2 format (see FontFile.py)
|
||||
|
||||
# --------------------------------------------------------------------
|
||||
|
@ -602,7 +605,7 @@ class FreeTypeFont:
|
|||
self,
|
||||
text,
|
||||
mode="",
|
||||
fill=None,
|
||||
fill=_UNSPECIFIED,
|
||||
direction=None,
|
||||
features=None,
|
||||
language=None,
|
||||
|
@ -676,7 +679,7 @@ class FreeTypeFont:
|
|||
:py:mod:`PIL.Image.core` interface module, and the text offset, the
|
||||
gap between the starting coordinate and the first marking
|
||||
"""
|
||||
if fill is not None:
|
||||
if fill is not _UNSPECIFIED:
|
||||
deprecate("fill", 10)
|
||||
else:
|
||||
fill = Image.core.fill
|
||||
|
|
Loading…
Reference in New Issue
Block a user