Skip to content

Commit

Permalink
Parse correct AST attribute for version
Browse files Browse the repository at this point in the history
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
  • Loading branch information
carlwgeorge committed Jun 15, 2018
1 parent 70c2fce commit d2640d3
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,14 @@
from setuptools import setup, find_packages

import ast
import sys

__AUTHOR__ = 'David Halter'
__AUTHOR_EMAIL__ = 'davidhalter88@gmail.com'

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

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

0 comments on commit d2640d3

Please sign in to comment.