Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gevent
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
Kirill Smelkov
gevent
Commits
48d70025
Commit
48d70025
authored
Dec 22, 2013
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix syntax of xtest_signal.py on python2.6
parent
0edc17f4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
30 deletions
+31
-30
greentest/xtest_signal.py
greentest/xtest_signal.py
+31
-30
No files found.
greentest/xtest_signal.py
View file @
48d70025
...
@@ -38,37 +38,38 @@ def test_main():
...
@@ -38,37 +38,38 @@ def test_main():
# re-raises information about any exceptions the child
# re-raises information about any exceptions the child
# throws. The real work happens in self.run_test().
# throws. The real work happens in self.run_test().
os_done_r
,
os_done_w
=
os
.
pipe
()
os_done_r
,
os_done_w
=
os
.
pipe
()
with
closing
(
os
.
fdopen
(
os_done_r
))
as
done_r
,
closing
(
os
.
fdopen
(
os_done_w
,
'w'
))
as
done_w
:
with
closing
(
os
.
fdopen
(
os_done_r
))
as
done_r
:
child
=
gevent
.
fork
()
with
closing
(
os
.
fdopen
(
os_done_w
,
'w'
))
as
done_w
:
if
not
child
:
child
=
gevent
.
fork
()
# In the child process; run the test and report results
if
not
child
:
# through the pipe.
# In the child process; run the test and report results
try
:
# through the pipe.
done_r
.
close
()
try
:
# Have to close done_w again here because
done_r
.
close
()
# exit_subprocess() will skip the enclosing with block.
# Have to close done_w again here because
with
closing
(
done_w
):
# exit_subprocess() will skip the enclosing with block.
try
:
with
closing
(
done_w
):
run_test
()
try
:
except
:
run_test
()
pickle
.
dump
(
traceback
.
format_exc
(),
done_w
)
except
:
else
:
pickle
.
dump
(
traceback
.
format_exc
(),
done_w
)
pickle
.
dump
(
None
,
done_w
)
else
:
except
:
pickle
.
dump
(
None
,
done_w
)
print
(
'Uh oh, raised from pickle.'
)
except
:
traceback
.
print_exc
()
print
(
'Uh oh, raised from pickle.'
)
finally
:
traceback
.
print_exc
()
os
.
_exit
(
0
)
finally
:
os
.
_exit
(
0
)
done_w
.
close
()
done_w
.
close
()
# Block for up to MAX_DURATION seconds for the test to finish.
# Block for up to MAX_DURATION seconds for the test to finish.
r
,
w
,
x
=
select
.
select
([
done_r
],
[],
[],
MAX_DURATION
)
r
,
w
,
x
=
select
.
select
([
done_r
],
[],
[],
MAX_DURATION
)
if
done_r
in
r
:
if
done_r
in
r
:
tb
=
pickle
.
load
(
done_r
)
tb
=
pickle
.
load
(
done_r
)
assert
not
tb
,
tb
assert
not
tb
,
tb
else
:
else
:
os
.
kill
(
child
,
9
)
os
.
kill
(
child
,
9
)
assert
False
,
'Test deadlocked after %d seconds.'
%
MAX_DURATION
assert
False
,
'Test deadlocked after %d seconds.'
%
MAX_DURATION
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
...
...
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