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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
735a0a87
Commit
735a0a87
authored
Aug 08, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disambiguate attribute name ("is_async_gen" it too close to an existing "is_asyncgen")
parent
9980ff6c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+5
-5
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+1
-1
No files found.
Cython/Compiler/Nodes.py
View file @
735a0a87
...
...
@@ -4031,12 +4031,12 @@ class GeneratorBodyDefNode(DefNode):
is_generator_body
=
True
is_inlined
=
False
is_async_gen
=
False
is_async_gen
_body
=
False
inlined_comprehension_type
=
None
# container type for inlined comprehensions
def
__init__
(
self
,
pos
=
None
,
name
=
None
,
body
=
None
,
is_async_gen
=
False
):
def
__init__
(
self
,
pos
=
None
,
name
=
None
,
body
=
None
,
is_async_gen
_body
=
False
):
super
(
GeneratorBodyDefNode
,
self
).
__init__
(
pos
=
pos
,
body
=
body
,
name
=
name
,
is_async_gen
=
is_async_gen
,
pos
=
pos
,
body
=
body
,
name
=
name
,
is_async_gen
_body
=
is_async_gen_body
,
doc
=
None
,
args
=
[],
star_arg
=
None
,
starstar_arg
=
None
)
def
declare_generator_body
(
self
,
env
):
...
...
@@ -4135,7 +4135,7 @@ class GeneratorBodyDefNode(DefNode):
# path: no traceback info is required and not creating it is much faster
if
not
self
.
is_inlined
and
not
self
.
body
.
is_terminator
:
code
.
putln
(
'PyErr_SetNone(%s);'
%
(
'__Pyx_PyExc_StopAsyncIteration'
if
self
.
is_async_gen
else
'PyExc_StopIteration'
))
'__Pyx_PyExc_StopAsyncIteration'
if
self
.
is_async_gen
_body
else
'PyExc_StopIteration'
))
# ----- Error cleanup
if
code
.
label_used
(
code
.
error_label
):
if
not
self
.
body
.
is_terminator
:
...
...
@@ -4146,7 +4146,7 @@ class GeneratorBodyDefNode(DefNode):
if
Future
.
generator_stop
in
env
.
global_scope
().
context
.
future_directives
:
# PEP 479: turn accidental StopIteration exceptions into a RuntimeError
code
.
globalstate
.
use_utility_code
(
UtilityCode
.
load_cached
(
"pep479"
,
"Coroutine.c"
))
code
.
putln
(
"__Pyx_Generator_Replace_StopIteration(%d);"
%
bool
(
self
.
is_async_gen
))
code
.
putln
(
"__Pyx_Generator_Replace_StopIteration(%d);"
%
bool
(
self
.
is_async_gen
_body
))
for
cname
,
type
in
code
.
funcstate
.
all_managed_temps
():
code
.
put_xdecref
(
cname
,
type
)
code
.
put_add_traceback
(
self
.
entry
.
qualified_name
)
...
...
Cython/Compiler/ParseTreeTransforms.py
View file @
735a0a87
...
...
@@ -2552,7 +2552,7 @@ class MarkClosureVisitor(CythonTransform):
gbody
=
Nodes
.
GeneratorBodyDefNode
(
pos
=
node
.
pos
,
name
=
node
.
name
,
body
=
node
.
body
,
is_async_gen
=
node
.
is_async_def
and
collector
.
has_yield
)
is_async_gen
_body
=
node
.
is_async_def
and
collector
.
has_yield
)
coroutine
=
coroutine_type
(
pos
=
node
.
pos
,
name
=
node
.
name
,
args
=
node
.
args
,
star_arg
=
node
.
star_arg
,
starstar_arg
=
node
.
starstar_arg
,
...
...
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