def move_or_copy(src, dst):
    try:
        os.rename(src, dst)
    except __HOLE__ as e:
        if e.errno == ERRNO_INVALID_CROSS_DEVICE_LINK:
            try:
                shutil.copy(src, dst)
            finally:
                os.unlink(src)
        else:
            raise
dataset/ETHPy150Open eallik/spinoff/spinoff/contrib/filetransfer/fileref.py/move_or_copy