mirror of
https://github.com/davidhalter/parso.git
synced 2026-08-13 03:21:02 +08:00
Fix a todo about __future__.
This commit is contained in:
@@ -14,8 +14,6 @@ _MAX_INDENT_COUNT = 100
|
|||||||
ALLOWED_FUTURES = (
|
ALLOWED_FUTURES = (
|
||||||
'all_feature_names', 'nested_scopes', 'generators', 'division',
|
'all_feature_names', 'nested_scopes', 'generators', 'division',
|
||||||
'absolute_import', 'with_statement', 'print_function', 'unicode_literals',
|
'absolute_import', 'with_statement', 'print_function', 'unicode_literals',
|
||||||
# TODO make this one optional in lower python versions.
|
|
||||||
'generator_stop'
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -288,6 +286,10 @@ class ErrorFinder(Normalizer):
|
|||||||
|
|
||||||
for from_name, future_name in node.get_paths():
|
for from_name, future_name in node.get_paths():
|
||||||
name = future_name.value
|
name = future_name.value
|
||||||
|
allowed_futures = list(ALLOWED_FUTURES)
|
||||||
|
if self._version >= (3, 5):
|
||||||
|
allowed_futures.append('generator_stop')
|
||||||
|
|
||||||
if name== 'braces':
|
if name== 'braces':
|
||||||
message = "not a chance"
|
message = "not a chance"
|
||||||
self._add_syntax_error(message, node)
|
self._add_syntax_error(message, node)
|
||||||
|
|||||||
Reference in New Issue
Block a user