[@spackbot] updating style on behalf of becker33
This commit is contained in:
parent
d31efd67ff
commit
5af37b7059
@ -57,6 +57,7 @@
|
|||||||
else:
|
else:
|
||||||
use_renameat2 = [False]
|
use_renameat2 = [False]
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(params=use_renameat2)
|
@pytest.fixture(params=use_renameat2)
|
||||||
def atomic_update_implementations(request, monkeypatch):
|
def atomic_update_implementations(request, monkeypatch):
|
||||||
monkeypatch.setattr(spack.util.atomic_update, "use_renameat2", lambda: request.param)
|
monkeypatch.setattr(spack.util.atomic_update, "use_renameat2", lambda: request.param)
|
||||||
@ -2181,7 +2182,7 @@ def test_view_link_type(
|
|||||||
mock_packages,
|
mock_packages,
|
||||||
mock_archive,
|
mock_archive,
|
||||||
install_mockery,
|
install_mockery,
|
||||||
atomic_update_implementations
|
atomic_update_implementations,
|
||||||
):
|
):
|
||||||
filename = str(tmpdir.join("spack.yaml"))
|
filename = str(tmpdir.join("spack.yaml"))
|
||||||
viewdir = str(tmpdir.join("view"))
|
viewdir = str(tmpdir.join("view"))
|
||||||
|
@ -3,13 +3,15 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
from contextlib import contextmanager
|
|
||||||
import os
|
import os
|
||||||
|
from contextlib import contextmanager
|
||||||
|
|
||||||
import llnl.util.filesystem as fs
|
import llnl.util.filesystem as fs
|
||||||
from llnl.util.symlink import symlink
|
from llnl.util.symlink import symlink
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from ctypes import CDLL
|
from ctypes import CDLL
|
||||||
|
|
||||||
libc = CDLL("/lib64/libc.so.6", 0x04) # 0x04 is RTLD_NOLOAD
|
libc = CDLL("/lib64/libc.so.6", 0x04) # 0x04 is RTLD_NOLOAD
|
||||||
except BaseException:
|
except BaseException:
|
||||||
libc = None
|
libc = None
|
||||||
@ -49,7 +51,9 @@ def atomic_update_renameat2(src, dest):
|
|||||||
with open_safely(src) as srcfd:
|
with open_safely(src) as srcfd:
|
||||||
with open_safely(dest) as destfd:
|
with open_safely(dest) as destfd:
|
||||||
try:
|
try:
|
||||||
libc.renameat2(srcfd, src.encode(), destfd, dest.encode(), 2) # 2 is RENAME_EXCHANGE
|
libc.renameat2(
|
||||||
|
srcfd, src.encode(), destfd, dest.encode(), 2
|
||||||
|
) # 2 is RENAME_EXCHANGE
|
||||||
if not dest_exists:
|
if not dest_exists:
|
||||||
os.unlink(src)
|
os.unlink(src)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
Loading…
Reference in New Issue
Block a user