mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +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 stat
|
||||||
import os
|
import os
|
||||||
import os.path
|
import os.path
|
||||||
|
import errno
|
||||||
import functools
|
import functools
|
||||||
from test import support
|
from test import support
|
||||||
from test.support import TESTFN
|
from test.support import TESTFN
|
||||||
|
@ -46,7 +47,7 @@ except ImportError:
|
||||||
|
|
||||||
def _fake_rename(*args, **kwargs):
|
def _fake_rename(*args, **kwargs):
|
||||||
# Pretend the destination path is on a different filesystem.
|
# 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):
|
def mock_rename(func):
|
||||||
@functools.wraps(func)
|
@functools.wraps(func)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue