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
2c006a7c
Commit
2c006a7c
authored
Apr 23, 2012
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Timeout: set default 'ref' to True (like it was until the previous patch)
parent
6a101b46
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
gevent/timeout.py
gevent/timeout.py
+4
-4
No files found.
gevent/timeout.py
View file @
2c006a7c
...
@@ -83,10 +83,10 @@ class Timeout(BaseException):
...
@@ -83,10 +83,10 @@ class Timeout(BaseException):
raise # not my timeout
raise # not my timeout
"""
"""
def
__init__
(
self
,
seconds
=
None
,
exception
=
None
):
def
__init__
(
self
,
seconds
=
None
,
exception
=
None
,
ref
=
True
):
self
.
seconds
=
seconds
self
.
seconds
=
seconds
self
.
exception
=
exception
self
.
exception
=
exception
self
.
timer
=
get_hub
().
loop
.
timer
(
seconds
or
0.0
,
ref
=
False
)
self
.
timer
=
get_hub
().
loop
.
timer
(
seconds
or
0.0
,
ref
=
ref
)
# we pass ref=False so that gevent.run() ignores oustanding timeouts
# we pass ref=False so that gevent.run() ignores oustanding timeouts
# we can do that because timeouts are always used with some other watchers
# we can do that because timeouts are always used with some other watchers
...
@@ -102,7 +102,7 @@ class Timeout(BaseException):
...
@@ -102,7 +102,7 @@ class Timeout(BaseException):
self
.
timer
.
start
(
getcurrent
().
throw
,
self
.
exception
)
self
.
timer
.
start
(
getcurrent
().
throw
,
self
.
exception
)
@
classmethod
@
classmethod
def
start_new
(
cls
,
timeout
=
None
,
exception
=
None
):
def
start_new
(
cls
,
timeout
=
None
,
exception
=
None
,
ref
=
True
):
"""Create a started :class:`Timeout`.
"""Create a started :class:`Timeout`.
This is a shortcut, the exact action depends on *timeout*'s type:
This is a shortcut, the exact action depends on *timeout*'s type:
...
@@ -117,7 +117,7 @@ class Timeout(BaseException):
...
@@ -117,7 +117,7 @@ class Timeout(BaseException):
if
not
timeout
.
pending
:
if
not
timeout
.
pending
:
timeout
.
start
()
timeout
.
start
()
return
timeout
return
timeout
timeout
=
cls
(
timeout
,
exception
)
timeout
=
cls
(
timeout
,
exception
,
ref
=
ref
)
timeout
.
start
()
timeout
.
start
()
return
timeout
return
timeout
...
...
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