Skip to content

Commit

Permalink
Parse _version contents instead of using exec()
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed May 10, 2024
1 parent 0cad346 commit 57399ce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
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 = {}
Expand Down

0 comments on commit 57399ce

Please sign in to comment.