fix CDLL failure on windows

This commit is contained in:
Gregory Becker 2023-03-27 13:25:48 -07:00
parent a30b07dd36
commit 9baea936f2

View File

@ -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)