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
1d80700d
Commit
1d80700d
authored
Jul 10, 2015
by
Jason Madden
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #608 from sublee/fix-607
Fix 607
parents
cd634cd7
114753f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
gevent/greenlet.py
gevent/greenlet.py
+1
-1
greentest/test__issue607.py
greentest/test__issue607.py
+42
-0
No files found.
gevent/greenlet.py
View file @
1d80700d
...
...
@@ -357,7 +357,7 @@ class Greenlet(greenlet):
self
.
__cancel_start
()
if
self
.
dead
:
self
.
__handle_death_before_start
()
self
.
__handle_death_before_start
(
exception
)
else
:
waiter
=
Waiter
()
self
.
parent
.
loop
.
run_callback
(
_kill
,
self
,
exception
,
waiter
)
...
...
greentest/test__issue607.py
0 → 100644
View file @
1d80700d
# A greenlet that's killed with an exception should fail.
import
greentest
import
gevent
class
ExpectedError
(
greentest
.
ExpectedException
):
pass
def
f
():
gevent
.
sleep
(
999
)
class
TestKillWithException
(
greentest
.
TestCase
):
def
test_kill_without_exception
(
self
):
g
=
gevent
.
spawn
(
f
)
g
.
kill
()
assert
g
.
successful
()
assert
isinstance
(
g
.
get
(),
gevent
.
GreenletExit
)
def
test_kill_with_exception
(
self
):
# issue-607 pointed this case.
g
=
gevent
.
spawn
(
f
)
g
.
kill
(
ExpectedError
)
assert
not
g
.
successful
()
self
.
assertRaises
(
ExpectedError
,
g
.
get
)
assert
g
.
value
is
None
assert
isinstance
(
g
.
exception
,
ExpectedError
)
def
test_kill_with_exception_after_started
(
self
):
g
=
gevent
.
spawn
(
f
)
g
.
join
(
0
)
g
.
kill
(
ExpectedError
)
assert
not
g
.
successful
()
self
.
assertRaises
(
ExpectedError
,
g
.
get
)
assert
g
.
value
is
None
assert
isinstance
(
g
.
exception
,
ExpectedError
)
if
__name__
==
'__main__'
:
greentest
.
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