Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
b37cd392
Commit
b37cd392
authored
May 07, 2011
by
Vinay Sajip
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed where socket close is called on connection failure.
parent
a55efb3b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
5 deletions
+6
-5
Lib/logging/handlers.py
Lib/logging/handlers.py
+6
-5
No files found.
Lib/logging/handlers.py
View file @
b37cd392
...
...
@@ -446,8 +446,12 @@ class SocketHandler(logging.Handler):
s
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
if
hasattr
(
s
,
'settimeout'
):
s
.
settimeout
(
timeout
)
s
.
connect
((
self
.
host
,
self
.
port
))
return
s
try
:
s
.
connect
((
self
.
host
,
self
.
port
))
return
s
except
socket
.
error
:
s
.
close
()
raise
def
createSocket
(
self
):
"""
...
...
@@ -469,9 +473,6 @@ class SocketHandler(logging.Handler):
self
.
retryTime
=
None
# next time, no delay before trying
except
socket
.
error
:
#Creation failed, so set the retry time and return.
if
self
.
sock
is
not
None
:
self
.
sock
.
close
()
self
.
sock
=
None
if
self
.
retryTime
is
None
:
self
.
retryPeriod
=
self
.
retryStart
else
:
...
...
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