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
ef3e7bf8
Commit
ef3e7bf8
authored
Feb 08, 2010
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
socket: use 'raise timeout("timed out")' instead of "raise timeout" to be more like stdlib's socket
parent
bb85f7a5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
gevent/socket.py
gevent/socket.py
+5
-5
No files found.
gevent/socket.py
View file @
ef3e7bf8
...
...
@@ -133,7 +133,7 @@ def _wait_helper(ev, evtype):
current
.
switch
(
ev
)
def
wait_read
(
fileno
,
timeout
=-
1
,
timeout_exc
=
_socket
.
timeout
):
def
wait_read
(
fileno
,
timeout
=-
1
,
timeout_exc
=
_socket
.
timeout
(
'timed out'
)
):
evt
=
core
.
read_event
(
fileno
,
_wait_helper
,
timeout
,
(
getcurrent
(),
timeout_exc
))
try
:
switch_result
=
get_hub
().
switch
()
...
...
@@ -142,7 +142,7 @@ def wait_read(fileno, timeout=-1, timeout_exc=_socket.timeout):
evt
.
cancel
()
def
wait_write
(
fileno
,
timeout
=-
1
,
timeout_exc
=
_socket
.
timeout
):
def
wait_write
(
fileno
,
timeout
=-
1
,
timeout_exc
=
_socket
.
timeout
(
'timed out'
)
):
evt
=
core
.
write_event
(
fileno
,
_wait_helper
,
timeout
,
(
getcurrent
(),
timeout_exc
))
try
:
switch_result
=
get_hub
().
switch
()
...
...
@@ -151,7 +151,7 @@ def wait_write(fileno, timeout=-1, timeout_exc=_socket.timeout):
evt
.
cancel
()
def
wait_readwrite
(
fileno
,
timeout
=-
1
,
timeout_exc
=
timeout
):
def
wait_readwrite
(
fileno
,
timeout
=-
1
,
timeout_exc
=
_socket
.
timeout
(
'timed out'
)
):
evt
=
core
.
readwrite_event
(
fileno
,
_wait_helper
,
timeout
,
(
getcurrent
(),
timeout_exc
))
try
:
switch_result
=
get_hub
().
switch
()
...
...
@@ -296,7 +296,7 @@ class socket(object):
elif
(
result
in
(
EWOULDBLOCK
,
EINPROGRESS
,
EALREADY
))
or
(
result
==
EINVAL
and
is_windows
):
timeleft
=
end
-
time
.
time
()
if
timeleft
<=
0
:
raise
timeout
raise
timeout
(
'timed out'
)
wait_readwrite
(
sock
.
fileno
(),
timeout
=
timeleft
)
else
:
raise
error
(
result
,
strerror
(
result
))
...
...
@@ -396,7 +396,7 @@ class socket(object):
break
timeleft
=
end
-
time
.
time
()
if
timeleft
<=
0
:
raise
timeout
raise
timeout
(
'timed out'
)
def
sendto
(
self
,
*
args
):
try
:
...
...
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