forked from mirrors/nixpkgs
24603db6a7
There are two more variants that should be packaged, one that uses Cython, and one that supports pooled connections. This package is the pure python version. Getting the docs to build required some work upstream, which is the reason for a bunch of the patching we currently carry. I expect this to go away over time, given that psycopg is very new-ish.
23 lines
735 B
Diff
23 lines
735 B
Diff
diff --git a/psycopg/psycopg/pq/_pq_ctypes.py b/psycopg/psycopg/pq/_pq_ctypes.py
|
|
index bf04d560..9e79fc3f 100644
|
|
--- a/psycopg/psycopg/pq/_pq_ctypes.py
|
|
+++ b/psycopg/psycopg/pq/_pq_ctypes.py
|
|
@@ -13,16 +13,7 @@ from typing import List, Optional, Tuple
|
|
|
|
from ..errors import NotSupportedError
|
|
|
|
-if sys.platform == "win32":
|
|
- libname = ctypes.util.find_library("libpq.dll")
|
|
-elif sys.platform == "darwin":
|
|
- libname = ctypes.util.find_library("libpq.dylib")
|
|
-else:
|
|
- libname = ctypes.util.find_library("pq")
|
|
-if not libname:
|
|
- raise ImportError("libpq library not found")
|
|
-
|
|
-pq = ctypes.cdll.LoadLibrary(libname)
|
|
+pq = ctypes.cdll.LoadLibrary("@libpq@")
|
|
|
|
# Get the libpq version to define what functions are available.
|
|
|