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
cbbcdbb3
Commit
cbbcdbb3
authored
Dec 22, 2016
by
Robert Bradshaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix withgil vs nogil patching.
parent
ea0cbaf7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
9 deletions
+19
-9
Cython/Compiler/PyrexTypes.py
Cython/Compiler/PyrexTypes.py
+13
-0
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+6
-9
No files found.
Cython/Compiler/PyrexTypes.py
View file @
cbbcdbb3
...
...
@@ -2532,6 +2532,19 @@ class CFuncType(CType):
","
.
join
(
arg_reprs
),
except_clause
)
def
with_with_gil
(
self
,
with_gil
):
if
with_gil
==
self
.
with_gil
:
return
self
else
:
return
CFuncType
(
self
.
return_type
,
self
.
args
,
self
.
has_varargs
,
self
.
exception_value
,
self
.
exception_check
,
self
.
calling_convention
,
self
.
nogil
,
with_gil
,
self
.
is_overridable
,
self
.
optional_arg_count
,
self
.
is_const_method
,
self
.
is_static_method
,
self
.
templates
,
self
.
is_strict_signature
)
def
calling_convention_prefix
(
self
):
cc
=
self
.
calling_convention
if
cc
:
...
...
Cython/Compiler/Symtab.py
View file @
cbbcdbb3
...
...
@@ -735,9 +735,8 @@ class Scope(object):
warning
(
pos
,
"Function '%s' previously declared as '%s'"
%
(
name
,
'cpdef'
if
overridable
else
'cdef'
),
1
)
if
entry
.
type
.
same_as
(
type
):
# Compatible signatures may have still be different types
# (e.g. nogil vs with gil).
entry
.
type
=
type
# Fix with_gil vs nogil.
entry
.
type
=
entry
.
type
.
with_with_gil
(
type
.
with_gil
)
else
:
if
visibility
==
'extern'
and
entry
.
visibility
==
'extern'
:
can_override
=
False
...
...
@@ -2085,9 +2084,8 @@ class CClassScope(ClassScope):
if
entry
.
is_final_cmethod
and
entry
.
is_inherited
:
error
(
pos
,
"Overriding final methods is not allowed"
)
elif
type
.
same_c_signature_as
(
entry
.
type
,
as_cmethod
=
1
)
and
type
.
nogil
==
entry
.
type
.
nogil
:
# Compatible signatures may have still be different types
# (e.g. nogil vs with gil).
entry
.
type
=
type
# Fix with_gil vs nogil.
entry
.
type
=
entry
.
type
.
with_with_gil
(
type
.
with_gil
)
elif
type
.
compatible_signature_with
(
entry
.
type
,
as_cmethod
=
1
)
and
type
.
nogil
==
entry
.
type
.
nogil
:
entry
=
self
.
add_cfunction
(
name
,
type
,
pos
,
cname
,
visibility
=
'ignore'
,
modifiers
=
modifiers
)
else
:
...
...
@@ -2222,9 +2220,8 @@ class CppClassScope(Scope):
entry
=
self
.
lookup_here
(
name
)
if
defining
and
entry
is
not
None
:
if
entry
.
type
.
same_as
(
type
):
# Compatible signatures may have still be different types
# (e.g. nogil vs with gil).
entry
.
type
=
type
# Fix with_gil vs nogil.
entry
.
type
=
entry
.
type
.
with_with_gil
(
type
.
with_gil
)
else
:
error
(
pos
,
"Function signature does not match previous declaration"
)
else
:
...
...
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