Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 03b0116

Browse files
committed
#5712: Preemptively fix some other possible timing issues.
1 parent 853c0f9 commit 03b0116

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/test/test_smtplib.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -626,12 +626,12 @@ def smtp_RCPT(self, arg):
626626
if self.rcpt_response is None:
627627
super().smtp_RCPT(arg)
628628
return
629-
self.push(self.rcpt_response[self.rcpt_count])
630629
self.rcpt_count += 1
630+
self.push(self.rcpt_response[self.rcpt_count-1])
631631

632632
def smtp_RSET(self, arg):
633-
super().smtp_RSET(arg)
634633
self.rset_count += 1
634+
super().smtp_RSET(arg)
635635

636636
def smtp_DATA(self, arg):
637637
if self.data_response is None:
@@ -794,7 +794,7 @@ def test_421_from_mail_cmd(self):
794794
with self.assertRaises(smtplib.SMTPSenderRefused):
795795
smtp.sendmail('John', 'Sally', 'test message')
796796
self.assertIsNone(smtp.sock)
797-
self.assertEqual(self.serv._SMTPchannel.rcpt_count, 0)
797+
self.assertEqual(self.serv._SMTPchannel.rset_count, 0)
798798

799799
def test_421_from_rcpt_cmd(self):
800800
smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)

0 commit comments

Comments
 (0)