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
7919aad8
Commit
7919aad8
authored
May 27, 2011
by
Mark Florisson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix two failing with gil tests in py24
parent
1f787515
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
8 deletions
+19
-8
runtests.py
runtests.py
+4
-2
tests/run/with_gil.pyx
tests/run/with_gil.pyx
+15
-6
No files found.
runtests.py
View file @
7919aad8
...
...
@@ -140,8 +140,10 @@ def get_openmp_compiler_flags(language):
if compiler_version and compiler_version.split('.') >= ['4', '2']:
return '-fopenmp', '-fopenmp'
locale.setlocale(locale.LC_ALL, '')
try:
locale.setlocale(locale.LC_ALL, '')
except locale.Error:
pass
OPENMP_C_COMPILER_FLAGS = get_openmp_compiler_flags('c')
OPENMP_CPP_COMPILER_FLAGS = get_openmp_compiler_flags('cpp')
...
...
tests/run/with_gil.pyx
View file @
7919aad8
...
...
@@ -24,6 +24,15 @@ cdef void puts(char *string) with gil:
"""
print
string
.
decode
(
'ascii'
)
class
ExceptionWithMsg
(
Exception
):
"""
In python2.4 Exception is formatted as <exceptions.Exception
instance at 0x1b8f948> when swallowed.
"""
def
__repr__
(
self
):
return
"ExceptionWithMsg(%r)"
%
self
.
args
# Start with some normal Python functions
...
...
@@ -251,7 +260,7 @@ cpdef test_cpdef():
cdef
void
void_nogil_ignore_exception
()
nogil
:
with
gil
:
raise
Exception
(
"This is swallowed"
)
raise
Exception
WithMsg
(
"This is swallowed"
)
puts
(
"unreachable"
)
with
gil
:
...
...
@@ -263,16 +272,16 @@ cdef void void_nogil_nested_gil() nogil:
with
gil
:
print
'Inner gil section'
puts
(
"nogil section"
)
raise
Exception
(
"Swallow this"
)
raise
Exception
WithMsg
(
"Swallow this"
)
puts
(
"Don't print this"
)
def
test_nogil_void_funcs_with_gil
():
"""
>>> redirect_stderr(test_nogil_void_funcs_with_gil)
Exception
Exception: Exception('This is swallowed',
) in 'with_gil.void_nogil_ignore_exception' ignored
Exception
with_gil.ExceptionWithMsg: ExceptionWithMsg('This is swallowed'
) in 'with_gil.void_nogil_ignore_exception' ignored
Inner gil section
nogil section
Exception
Exception: Exception('Swallow this',
) in 'with_gil.void_nogil_nested_gil' ignored
Exception
with_gil.ExceptionWithMsg: ExceptionWithMsg('Swallow this'
) in 'with_gil.void_nogil_nested_gil' ignored
"""
void_nogil_ignore_exception
()
void_nogil_nested_gil
()
...
...
@@ -280,10 +289,10 @@ def test_nogil_void_funcs_with_gil():
def
test_nogil_void_funcs_with_nogil
():
"""
>>> redirect_stderr(test_nogil_void_funcs_with_nogil)
Exception
Exception: Exception('This is swallowed',
) in 'with_gil.void_nogil_ignore_exception' ignored
Exception
with_gil.ExceptionWithMsg: ExceptionWithMsg('This is swallowed'
) in 'with_gil.void_nogil_ignore_exception' ignored
Inner gil section
nogil section
Exception
Exception: Exception('Swallow this',
) in 'with_gil.void_nogil_nested_gil' ignored
Exception
with_gil.ExceptionWithMsg: ExceptionWithMsg('Swallow this'
) in 'with_gil.void_nogil_nested_gil' ignored
"""
with
nogil
:
void_nogil_ignore_exception
()
...
...
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