Moved warning to end of execution

This commit is contained in:
Andrew Murray 2020-10-12 18:38:36 +11:00
parent 15c339470d
commit c2890d1f10

View File

@ -38,13 +38,17 @@ ZLIB_ROOT = None
if sys.platform == "win32" and sys.version_info >= (3, 10):
warnings.warn(
import atexit
atexit.register(
lambda: warnings.warn(
f"Pillow {PILLOW_VERSION} does not support Python "
f"{sys.version_info.major}.{sys.version_info.minor} and does not provide "
"prebuilt Windows binaries. We do not recommend building from source on "
"Windows.",
RuntimeWarning,
)
)
_IMAGING = ("decode", "encode", "map", "display", "outline", "path")