Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
abe58b24
Commit
abe58b24
authored
Jan 07, 2019
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "generator_stop" to default future imports for language_level=3.
See #2580.
parent
4ee7ae77
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
Cython/Compiler/Main.py
Cython/Compiler/Main.py
+3
-3
No files found.
Cython/Compiler/Main.py
View file @
abe58b24
...
@@ -98,16 +98,16 @@ class Context(object):
...
@@ -98,16 +98,16 @@ class Context(object):
self
.
gdb_debug_outputwriter
=
None
self
.
gdb_debug_outputwriter
=
None
def
set_language_level
(
self
,
level
):
def
set_language_level
(
self
,
level
):
from
.Future
import
print_function
,
unicode_literals
,
absolute_import
,
division
from
.Future
import
print_function
,
unicode_literals
,
absolute_import
,
division
,
generator_stop
future_directives
=
[]
future_directives
=
[]
if
level
==
'3str'
:
if
level
==
'3str'
:
future_directives
=
[
print_function
,
absolute_import
,
division
]
future_directives
=
[
print_function
,
absolute_import
,
division
,
generator_stop
]
self
.
future_directives
.
discard
(
unicode_literals
)
self
.
future_directives
.
discard
(
unicode_literals
)
level
=
3
level
=
3
else
:
else
:
level
=
int
(
level
)
level
=
int
(
level
)
if
level
>=
3
:
if
level
>=
3
:
future_directives
=
[
print_function
,
unicode_literals
,
absolute_import
,
division
]
future_directives
=
[
print_function
,
unicode_literals
,
absolute_import
,
division
,
generator_stop
]
self
.
language_level
=
level
self
.
language_level
=
level
if
future_directives
:
if
future_directives
:
self
.
future_directives
.
update
(
future_directives
)
self
.
future_directives
.
update
(
future_directives
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment