FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Assert palette is not None by radarhere · Pull Request #8877 · python-pillow/Pillow · GitHub

Assert palette is not None - #8877

Merged
hugovk merged 1 commit into
python-pillow:mainfrom
radarhere:palette
Jun 27, 2025
Merged

Assert palette is not None#8877
hugovk merged 1 commit into
python-pillow:mainfrom
radarhere:palette

Conversation

Copy link
Copy Markdown
Member

This is part of #8362 - I'm hoping to break down that PR into easier-to-review chunks.

Image's palette may be None

>>> from PIL import Image
>>> im = Image.new("RGB", (1, 1))
>>> im.palette is None
True

So before using it, let's assert that it isn't None.

hugovk merged commit 3a18e55 into python-pillow:main Jun 27, 2025
radarhere deleted the palette branch June 27, 2025 15:16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL