Skip to content

Commit 1c27be3

Browse files
committed
Do not use exec in setup.py
1 parent 2c8cf5c commit 1c27be3

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

setup.py

+3-6
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@
99
with open(os.path.join(os.path.dirname(__file__), "README.rst")) as readme:
1010
LONG_DESCRIPTION = readme.read()
1111

12-
# https://packaging.python.org/en/latest/single_source_version.html
13-
try:
14-
execfile('fastjsonschema/version.py')
15-
except NameError:
16-
exec(open('fastjsonschema/version.py').read())
17-
12+
# https://packaging.python.org/en/latest/guides/single-sourcing-package-version/
13+
with open(os.path.join(os.path.dirname(__file__), "fastjsonschema", "version.py")) as versionFile:
14+
VERSION = versionFile.read().split("'")[1]
1815

1916
setup(
2017
name='fastjsonschema',

0 commit comments

Comments
 (0)