From 9baea936f23c7223178c53beaae63237de6cf805 Mon Sep 17 00:00:00 2001 From: Gregory Becker Date: Mon, 27 Mar 2023 13:25:48 -0700 Subject: [PATCH] fix CDLL failure on windows --- lib/spack/spack/util/atomic_update.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/spack/spack/util/atomic_update.py b/lib/spack/spack/util/atomic_update.py index 23d0d7d831d..f9aa8b5f860 100644 --- a/lib/spack/spack/util/atomic_update.py +++ b/lib/spack/spack/util/atomic_update.py @@ -19,7 +19,9 @@ # python links against libc, so we can treat this as a libc handle # we could also use CDLL("libc.so.6") but this is (irrelevantly) more future proof libc = ctypes.CDLL(None) -except OSError: +except (OSError, TypeError): + # OSError if the call fails, + # TypeError on Windows pass renameat2 = getattr(libc, "renameat2", None)