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
31cfb782
Commit
31cfb782
authored
Mar 21, 2011
by
Denis Bilenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
socket: update create_connection. fixes issue #74
parent
a2387f8a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
gevent/socket.py
gevent/socket.py
+7
-3
No files found.
gevent/socket.py
View file @
31cfb782
...
...
@@ -627,8 +627,8 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=N
An host of '' or port 0 tells the OS to use the default.
"""
msg
=
"getaddrinfo returns an empty list"
host
,
port
=
address
err
=
None
for
res
in
getaddrinfo
(
host
,
port
,
0
,
SOCK_STREAM
):
af
,
socktype
,
proto
,
_canonname
,
sa
=
res
sock
=
None
...
...
@@ -640,11 +640,15 @@ def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=N
sock
.
bind
(
source_address
)
sock
.
connect
(
sa
)
return
sock
except
error
,
msg
:
except
error
,
ex
:
err
=
ex
sys
.
exc_clear
()
if
sock
is
not
None
:
sock
.
close
()
raise
msg
if
err
is
not
None
:
raise
err
else
:
raise
error
(
"getaddrinfo returns an empty list"
)
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