mirror of
				https://github.com/python/cpython.git
				synced 2025-11-04 07:31:38 +00:00 
			
		
		
		
	Mock the rename failure a bit better
This commit is contained in:
		
							parent
							
								
									5e458f520c
								
							
						
					
					
						commit
						c041ab6c7d
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -7,6 +7,7 @@
 | 
			
		|||
import stat
 | 
			
		||||
import os
 | 
			
		||||
import os.path
 | 
			
		||||
import errno
 | 
			
		||||
import functools
 | 
			
		||||
from test import support
 | 
			
		||||
from test.support import TESTFN
 | 
			
		||||
| 
						 | 
				
			
			@ -46,7 +47,7 @@
 | 
			
		|||
 | 
			
		||||
def _fake_rename(*args, **kwargs):
 | 
			
		||||
    # Pretend the destination path is on a different filesystem.
 | 
			
		||||
    raise OSError()
 | 
			
		||||
    raise OSError(getattr(errno, 'EXDEV', 18), "Invalid cross-device link")
 | 
			
		||||
 | 
			
		||||
def mock_rename(func):
 | 
			
		||||
    @functools.wraps(func)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue