mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Merge: #5712: Preemptively fix some other possible timing issues.
This commit is contained in:
		
						commit
						54bd49d49b
					
				
					 1 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
					@ -668,12 +668,12 @@ def smtp_RCPT(self, arg):
 | 
				
			||||||
        if self.rcpt_response is None:
 | 
					        if self.rcpt_response is None:
 | 
				
			||||||
            super().smtp_RCPT(arg)
 | 
					            super().smtp_RCPT(arg)
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        self.push(self.rcpt_response[self.rcpt_count])
 | 
					 | 
				
			||||||
        self.rcpt_count += 1
 | 
					        self.rcpt_count += 1
 | 
				
			||||||
 | 
					        self.push(self.rcpt_response[self.rcpt_count-1])
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def smtp_RSET(self, arg):
 | 
					    def smtp_RSET(self, arg):
 | 
				
			||||||
        super().smtp_RSET(arg)
 | 
					 | 
				
			||||||
        self.rset_count += 1
 | 
					        self.rset_count += 1
 | 
				
			||||||
 | 
					        super().smtp_RSET(arg)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def smtp_DATA(self, arg):
 | 
					    def smtp_DATA(self, arg):
 | 
				
			||||||
        if self.data_response is None:
 | 
					        if self.data_response is None:
 | 
				
			||||||
| 
						 | 
					@ -853,7 +853,7 @@ def test_421_from_mail_cmd(self):
 | 
				
			||||||
        with self.assertRaises(smtplib.SMTPSenderRefused):
 | 
					        with self.assertRaises(smtplib.SMTPSenderRefused):
 | 
				
			||||||
            smtp.sendmail('John', 'Sally', 'test message')
 | 
					            smtp.sendmail('John', 'Sally', 'test message')
 | 
				
			||||||
        self.assertIsNone(smtp.sock)
 | 
					        self.assertIsNone(smtp.sock)
 | 
				
			||||||
        self.assertEqual(self.serv._SMTPchannel.rcpt_count, 0)
 | 
					        self.assertEqual(self.serv._SMTPchannel.rset_count, 0)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_421_from_rcpt_cmd(self):
 | 
					    def test_421_from_rcpt_cmd(self):
 | 
				
			||||||
        smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
 | 
					        smtp = smtplib.SMTP(HOST, self.port, local_hostname='localhost', timeout=15)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue