You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
koji/4100.patch

34 lines
978 B

From a241746b2a496540bb6cbe64a5b59eb5bb1c50a6 Mon Sep 17 00:00:00 2001
From: Miro Hrončok <miro@hroncok.cz>
Date: May 28 2024 20:10:07 +0000
Subject: setup.py: Fix version retrieval on Python 3.13+
Accessing __version__ from locals() no longer works.
This was reported to Python in https://github.com/python/cpython/issues/118888
but according to Python developers, it:
- is an intended change of behavior described in PEP 667
- was an illegal usage that happens to work in a favored way to begin with
---
diff --git a/setup.py b/setup.py
index 91f7d76..4d38c08 100755
--- a/setup.py
+++ b/setup.py
@@ -25,8 +25,9 @@ def get_install_requires():
def get_version():
cwd = os.path.dirname(__file__)
- exec(open(os.path.join(cwd, 'koji/_version.py'), 'rt').read())
- return locals()['__version__']
+ lcls = {}
+ exec(open(os.path.join(cwd, 'koji/_version.py'), 'rt').read(), None, lcls)
+ return lcls['__version__']
def get_long_description():