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)