Parse _version contents instead of using exec()

This commit is contained in:
Andrew Murray 2024-05-10 22:43:56 +10:00
parent 0cad346fc9
commit 57399ce204

View File

@ -23,8 +23,7 @@ from setuptools.command.build_ext import build_ext
def get_version():
version_file = "src/PIL/_version.py"
with open(version_file, encoding="utf-8") as f:
exec(compile(f.read(), version_file, "exec"))
return locals()["__version__"]
return f.read().split('"')[1]
configuration = {}