]> git.ipfire.org Git - thirdparty/psycopg.git/commit
fix: add `libc.so` fallback for musl systems to the ctypes impl
authorMichał Górny <mgorny@gentoo.org>
Sat, 27 Jan 2024 14:28:34 +0000 (15:28 +0100)
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>
Mon, 29 Jan 2024 00:15:41 +0000 (00:15 +0000)
commit46381be39e679dc608151c9a4bb8814092b0ce3f
treea5b68804526b18173a3ba2d2a732ce5cfc1a8620
parentad21fb768bd3b2181a0323d7d8d032dcc48b2bd9
fix: add `libc.so` fallback for musl systems to the ctypes impl

Add a fallback to `libc.so` library name to fix loading the ctypes
implementation on musl systems.  On musl, `find_library("c")` does
not work (the problem has been reported to CPython in 2014, and has not
been resolved yet), causing the module to fail on `assert libcname`.
Instead, add a fallback to using `libc.so` and let ctypes raise
an exception if such a library does not exist.
psycopg/psycopg/pq/_pq_ctypes.py