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
1660933d
Commit
1660933d
authored
Feb 23, 2008
by
Facundo Batista
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 1776581. Minor corrections to smtplib, and two small tests.
Thanks Alan McIntyre.
parent
fc2d0103
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
Lib/smtplib.py
Lib/smtplib.py
+2
-2
Lib/test/test_smtplib.py
Lib/test/test_smtplib.py
+3
-2
No files found.
Lib/smtplib.py
View file @
1660933d
...
...
@@ -298,7 +298,7 @@ class SMTP:
def send(self, str):
"""Send `str'
to
the
server
.
"""
if self.debuglevel > 0: print>>stderr, 'send:', repr(str)
if self.sock:
if
hasattr(self, 'sock') and
self.sock:
try:
self.sock.sendall(str)
except socket.error:
...
...
@@ -486,7 +486,7 @@ class SMTP:
vrfy=verify
def expn(self, address):
"""
SMTP
'
verify'
command
--
checks
for
address
validity
.
"""
"""
SMTP
'
expn'
command
--
expands
a
mailing
list
.
"""
self.putcmd("expn", quoteaddr(address))
return self.getreply()
...
...
Lib/test/test_smtplib.py
View file @
1660933d
...
...
@@ -82,8 +82,9 @@ class GeneralTests(TestCase):
# to reference the nonexistent 'sock' attribute of the SMTP object
# causes an AttributeError)
smtp
=
smtplib
.
SMTP
()
self
.
assertRaises
(
AttributeError
,
smtp
.
ehlo
)
self
.
assertRaises
(
AttributeError
,
smtp
.
send
,
'test msg'
)
self
.
assertRaises
(
smtplib
.
SMTPServerDisconnected
,
smtp
.
ehlo
)
self
.
assertRaises
(
smtplib
.
SMTPServerDisconnected
,
smtp
.
send
,
'test msg'
)
def
testLocalHostName
(
self
):
# check that supplied local_hostname is used
...
...
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