Skip to content

Commit ff4a773

Browse files
carlwgeorgedavidhalter
authored andcommitted
Parse correct AST attribute for version
Earlier development versions of Python 3.7 added the docstring field to AST nodes. This was later reverted in Python 3.7.0b5. https://bugs.python.org/issue29463 python/cpython#7121
1 parent 70c2fce commit ff4a773

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

setup.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,14 @@
33
from setuptools import setup, find_packages
44

55
import ast
6-
import sys
76

87
__AUTHOR__ = 'David Halter'
98
__AUTHOR_EMAIL__ = 'davidhalter88@gmail.com'
109

1110
# Get the version from within jedi. It's defined in exactly one place now.
1211
with open('jedi/__init__.py') as f:
1312
tree = ast.parse(f.read())
14-
if sys.version_info > (3, 7):
15-
version = tree.body[0].value.s
16-
else:
17-
version = tree.body[1].value.s
13+
version = tree.body[1].value.s
1814

1915
readme = open('README.rst').read() + '\n\n' + open('CHANGELOG.rst').read()
2016
with open('requirements.txt') as f:

0 commit comments

Comments
 (0)