mirror of
				https://github.com/python/cpython.git
				synced 2025-11-03 23:21:29 +00:00 
			
		
		
		
	Fix ResourceWarnings in test_subprocess.
This commit is contained in:
		
							parent
							
								
									72d161af51
								
							
						
					
					
						commit
						0d7cda3e63
					
				
					 1 changed files with 4 additions and 0 deletions
				
			
		| 
						 | 
					@ -1404,6 +1404,8 @@ def test_zombie_fast_process_del(self):
 | 
				
			||||||
                              'time.sleep(0.2)'],
 | 
					                              'time.sleep(0.2)'],
 | 
				
			||||||
                             stdout=subprocess.PIPE,
 | 
					                             stdout=subprocess.PIPE,
 | 
				
			||||||
                             stderr=subprocess.PIPE)
 | 
					                             stderr=subprocess.PIPE)
 | 
				
			||||||
 | 
					        self.addCleanup(p.stdout.close)
 | 
				
			||||||
 | 
					        self.addCleanup(p.stderr.close)
 | 
				
			||||||
        ident = id(p)
 | 
					        ident = id(p)
 | 
				
			||||||
        pid = p.pid
 | 
					        pid = p.pid
 | 
				
			||||||
        del p
 | 
					        del p
 | 
				
			||||||
| 
						 | 
					@ -1421,6 +1423,8 @@ def test_leak_fast_process_del_killed(self):
 | 
				
			||||||
                              'time.sleep(3)'],
 | 
					                              'time.sleep(3)'],
 | 
				
			||||||
                             stdout=subprocess.PIPE,
 | 
					                             stdout=subprocess.PIPE,
 | 
				
			||||||
                             stderr=subprocess.PIPE)
 | 
					                             stderr=subprocess.PIPE)
 | 
				
			||||||
 | 
					        self.addCleanup(p.stdout.close)
 | 
				
			||||||
 | 
					        self.addCleanup(p.stderr.close)
 | 
				
			||||||
        ident = id(p)
 | 
					        ident = id(p)
 | 
				
			||||||
        pid = p.pid
 | 
					        pid = p.pid
 | 
				
			||||||
        del p
 | 
					        del p
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue