mirror of
https://github.com/python/cpython.git
synced 2025-08-29 13:15:11 +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 sys
|
|||
import stat
|
||||
import os
|
||||
import os.path
|
||||
import errno
|
||||
import functools
|
||||
from test import support
|
||||
from test.support import TESTFN
|
||||
|
@ -46,7 +47,7 @@ except ImportError:
|
|||
|
||||
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