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
Boxiang Sun
cython
Commits
e9e67551
Commit
e9e67551
authored
Mar 16, 2011
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow 'with cython.nogil:' statement
parent
7f141057
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
Cython/Compiler/ParseTreeTransforms.py
Cython/Compiler/ParseTreeTransforms.py
+2
-2
No files found.
Cython/Compiler/ParseTreeTransforms.py
View file @
e9e67551
...
...
@@ -946,9 +946,9 @@ class InterpretCompilerDirectives(CythonTransform, SkipDeclarations):
PostParseError
(
node
.
pos
,
"Compiler directive with statements cannot contain 'as'"
))
else
:
name
,
value
=
directive
if
name
==
'nogil'
:
if
name
in
(
'nogil'
,
'gil'
)
:
# special case: in pure mode, "with nogil" spells "with cython.nogil"
node
=
Nodes
.
GILStatNode
(
node
.
pos
,
state
=
"nogil"
,
body
=
node
.
body
)
node
=
Nodes
.
GILStatNode
(
node
.
pos
,
state
=
name
,
body
=
node
.
body
)
return
self
.
visit_Node
(
node
)
if
self
.
check_directive_scope
(
node
.
pos
,
name
,
'with statement'
):
directive_dict
[
name
]
=
value
...
...
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