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
e4056355
Commit
e4056355
authored
Nov 17, 2017
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent incorrect warning about "boundscheck" in nogil with-blocks.
Closes #2002.
parent
e3d06a43
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+5
-4
No files found.
Cython/Compiler/ExprNodes.py
View file @
e4056355
...
...
@@ -4145,10 +4145,6 @@ class BufferIndexNode(_IndexingBaseNode):
def
nogil_check
(
self
,
env
):
if
self
.
is_buffer_access
or
self
.
is_memview_index
:
if
env
.
directives
[
'boundscheck'
]:
warning
(
self
.
pos
,
"Use boundscheck(False) for faster access"
,
level
=
1
)
if
self
.
type
.
is_pyobject
:
error
(
self
.
pos
,
"Cannot access buffer with object dtype without gil"
)
self
.
type
=
error_type
...
...
@@ -4175,6 +4171,11 @@ class BufferIndexNode(_IndexingBaseNode):
"""
ndarray[1, 2, 3] and memslice[1, 2, 3]
"""
if
self
.
in_nogil_context
:
if
self
.
is_buffer_access
or
self
.
is_memview_index
:
if
code
.
globalstate
.
directives
[
'boundscheck'
]:
warning
(
self
.
pos
,
"Use boundscheck(False) for faster access"
,
level
=
1
)
# Assign indices to temps of at least (s)size_t to allow further index calculations.
index_temps
=
[
self
.
get_index_in_temp
(
code
,
ivar
)
for
ivar
in
self
.
indices
]
...
...
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