summaryrefslogtreecommitdiff
path: root/dev-python/pillow/files/pillow-10.3.0-py313.patch
blob: 1574d6be3cefcfa13dfa938580b75c00e7f770e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
From 57399ce204d79c74c80612c622bb788e20d786e8 Mon Sep 17 00:00:00 2001
From: Andrew Murray <radarhere@users.noreply.github.com>
Date: Fri, 10 May 2024 22:43:56 +1000
Subject: [PATCH] Parse _version contents instead of using exec()

---
 setup.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/setup.py b/setup.py
index 7d8e1c1ee21..abdd87ea252 100644
--- a/setup.py
+++ b/setup.py
@@ -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 = {}