Skip to content

Commit a724c77

Browse files
authored
Fix get_version for Python 3.13
See python/cpython#118888
1 parent 7552a77 commit a724c77

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎setup.py‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,10 @@ def write_version_py():
6767

6868

6969
def get_version():
70+
d = {}
7071
with open(version_file, 'r') as f:
71-
exec(compile(f.read(), version_file, 'exec'))
72-
return locals()['__version__']
72+
exec(compile(f.read(), version_file, 'exec'), globals(), d)
73+
return d['__version__']
7374

7475

7576
def get_requirements(filename='requirements.txt'):

0 commit comments

Comments
 (0)