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
81c87c5e
Commit
81c87c5e
authored
Nov 10, 2010
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Followup to r86383: it seems that in some cases (buildbots), the server
closes the connection before we can call shutdown().
parent
1790ed2b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
Lib/imaplib.py
Lib/imaplib.py
+9
-3
No files found.
Lib/imaplib.py
View file @
81c87c5e
...
...
@@ -22,7 +22,7 @@ Public functions: Internaldate2tuple
__version__
=
"2.58"
import
binascii
,
random
,
re
,
socket
,
subprocess
,
sys
,
time
import
binascii
,
errno
,
random
,
re
,
socket
,
subprocess
,
sys
,
time
__all__
=
[
"IMAP4"
,
"IMAP4_stream"
,
"Internaldate2tuple"
,
"Int2AP"
,
"ParseFlags"
,
"Time2Internaldate"
]
...
...
@@ -260,8 +260,14 @@ class IMAP4:
def
shutdown
(
self
):
"""Close I/O established in "open"."""
self
.
file
.
close
()
self
.
sock
.
shutdown
(
socket
.
SHUT_RDWR
)
self
.
sock
.
close
()
try
:
self
.
sock
.
shutdown
(
socket
.
SHUT_RDWR
)
except
socket
.
error
as
e
:
# The server might already have closed the connection
if
e
.
errno
!=
errno
.
ENOTCONN
:
raise
finally
:
self
.
sock
.
close
()
def
socket
(
self
):
...
...
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