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
This commit is contained in:
parent
2bf10c7010
commit
7dd9a83612
1 changed files with 3 additions and 2 deletions
5
setup.py
5
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():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue