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
Gwenaël Samain
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):
...
@@ -2532,6 +2532,19 @@ class CFuncType(CType):
","
.
join
(
arg_reprs
),
","
.
join
(
arg_reprs
),
except_clause
)
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
):
def
calling_convention_prefix
(
self
):
cc
=
self
.
calling_convention
cc
=
self
.
calling_convention
if
cc
:
if
cc
:
...
...
Cython/Compiler/Symtab.py
View file @
cbbcdbb3
...
@@ -735,9 +735,8 @@ class Scope(object):
...
@@ -735,9 +735,8 @@ class Scope(object):
warning
(
pos
,
"Function '%s' previously declared as '%s'"
%
(
warning
(
pos
,
"Function '%s' previously declared as '%s'"
%
(
name
,
'cpdef'
if
overridable
else
'cdef'
),
1
)
name
,
'cpdef'
if
overridable
else
'cdef'
),
1
)
if
entry
.
type
.
same_as
(
type
):
if
entry
.
type
.
same_as
(
type
):
# Compatible signatures may have still be different types
# Fix with_gil vs nogil.
# (e.g. nogil vs with gil).
entry
.
type
=
entry
.
type
.
with_with_gil
(
type
.
with_gil
)
entry
.
type
=
type
else
:
else
:
if
visibility
==
'extern'
and
entry
.
visibility
==
'extern'
:
if
visibility
==
'extern'
and
entry
.
visibility
==
'extern'
:
can_override
=
False
can_override
=
False
...
@@ -2085,9 +2084,8 @@ class CClassScope(ClassScope):
...
@@ -2085,9 +2084,8 @@ class CClassScope(ClassScope):
if
entry
.
is_final_cmethod
and
entry
.
is_inherited
:
if
entry
.
is_final_cmethod
and
entry
.
is_inherited
:
error
(
pos
,
"Overriding final methods is not allowed"
)
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
:
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
# Fix with_gil vs nogil.
# (e.g. nogil vs with gil).
entry
.
type
=
entry
.
type
.
with_with_gil
(
type
.
with_gil
)
entry
.
type
=
type
elif
type
.
compatible_signature_with
(
entry
.
type
,
as_cmethod
=
1
)
and
type
.
nogil
==
entry
.
type
.
nogil
:
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
)
entry
=
self
.
add_cfunction
(
name
,
type
,
pos
,
cname
,
visibility
=
'ignore'
,
modifiers
=
modifiers
)
else
:
else
:
...
@@ -2222,9 +2220,8 @@ class CppClassScope(Scope):
...
@@ -2222,9 +2220,8 @@ class CppClassScope(Scope):
entry
=
self
.
lookup_here
(
name
)
entry
=
self
.
lookup_here
(
name
)
if
defining
and
entry
is
not
None
:
if
defining
and
entry
is
not
None
:
if
entry
.
type
.
same_as
(
type
):
if
entry
.
type
.
same_as
(
type
):
# Compatible signatures may have still be different types
# Fix with_gil vs nogil.
# (e.g. nogil vs with gil).
entry
.
type
=
entry
.
type
.
with_with_gil
(
type
.
with_gil
)
entry
.
type
=
type
else
:
else
:
error
(
pos
,
"Function signature does not match previous declaration"
)
error
(
pos
,
"Function signature does not match previous declaration"
)
else
:
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