summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Popa <pcmanticore@gmail.com>2019-02-19 08:53:07 +0100
committerClaudiu Popa <pcmanticore@gmail.com>2019-02-19 08:53:07 +0100
commit7d3107441f6db2153157ad0f0de65bb18d5d0773 (patch)
tree089b1507746ebbaee452037ce5b43d0d40466a9f
parente084ae9fc6e21baed5092ca855935408bac936a7 (diff)
downloadastroid-git-7d3107441f6db2153157ad0f0de65bb18d5d0773.tar.gz
Update to typed-ast 1.3 and drop the Python 3.7 restriction
Close #646
-rw-r--r--ChangeLog2
-rw-r--r--astroid/__pkginfo__.py2
-rw-r--r--astroid/_ast.py5
3 files changed, 3 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index d6b6f4f1..3804be0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,8 @@ What's New in astroid 2.2.0?
============================
Release Date: TBA
+* ``typed_ast`` gets installed for Python 3.7, meaning type comments can now work on 3.7.
+
* Fix a bug concerning inference of unary operators on numpy types.
Close PyCQA/pylint#2436 (first part)
diff --git a/astroid/__pkginfo__.py b/astroid/__pkginfo__.py
index 81177c87..afc660e7 100644
--- a/astroid/__pkginfo__.py
+++ b/astroid/__pkginfo__.py
@@ -30,7 +30,7 @@ install_requires = [
"six",
"wrapt",
'typing;python_version<"3.5"',
- 'typed-ast<=1.2.0;python_version<"3.7" and implementation_name== "cpython"',
+ 'typed-ast>=1.3.0;implementation_name== "cpython"',
]
# pylint: disable=redefined-builtin; why license is a builtin anyway?
diff --git a/astroid/_ast.py b/astroid/_ast.py
index 7868a7f3..f6858ae0 100644
--- a/astroid/_ast.py
+++ b/astroid/_ast.py
@@ -1,5 +1,4 @@
import ast
-import sys
from collections import namedtuple
from typing import Optional
@@ -17,10 +16,6 @@ FunctionType = namedtuple("FunctionType", ["argtypes", "returns"])
def _get_parser_module(parse_python_two: bool = False):
if parse_python_two:
parser_module = _ast_py2
- elif sys.version_info[:2] >= (3, 7):
- # The typed_ast module doesn't support the full 3.7 syntax yet.
- # Remove once typed_ast is updated.
- parser_module = ast
else:
parser_module = _ast_py3
return parser_module or ast