Skip to content

Commit

Permalink
litestar
Browse files Browse the repository at this point in the history
  • Loading branch information
Bot-wxt1221 committed Jan 20, 2025
1 parent b70cc1a commit 058bc95
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions pkgs/development/python-modules/psycopg/ctypes.patch
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
diff --git a/psycopg/psycopg/pq/_pq_ctypes.py b/psycopg/psycopg/pq/_pq_ctypes.py
index 1b0f391f..38bb0fd9 100644
index f3a7b143..1bf935fb 100644
--- a/psycopg/psycopg/pq/_pq_ctypes.py
+++ b/psycopg/psycopg/pq/_pq_ctypes.py
@@ -11,14 +11,9 @@ from ctypes import Structure, CFUNCTYPE, POINTER
@@ -13,14 +13,11 @@ from ctypes import Structure, CFUNCTYPE, POINTER
from ctypes import c_char, c_char_p, c_int, c_size_t, c_ubyte, c_uint, c_void_p
from typing import List, Optional, Tuple
from typing import Any, NoReturn

-from .misc import find_libpq_full_path
-from .misc import find_libpq_full_path, version_pretty
+from .misc import version_pretty
from ..errors import NotSupportedError

-libname = find_libpq_full_path()
-if not libname:
- raise ImportError("libpq library not found")
-
-pq = ctypes.cdll.LoadLibrary(libname)
+pq = ctypes.cdll.LoadLibrary("@libpq@")


class FILE(Structure):
@@ -28,12 +23,7 @@ class FILE(Structure):
@@ -30,12 +27,7 @@ class FILE(Structure):
FILE_ptr = POINTER(FILE)

if sys.platform == "linux":
Expand All @@ -33,10 +34,10 @@ index 1b0f391f..38bb0fd9 100644
fdopen = libc.fdopen
fdopen.argtypes = (c_int, c_char_p)
diff --git a/tests/fix_pq.py b/tests/fix_pq.py
index 917dfc91..5e360fb3 100644
index 1cff7e18..218d90a0 100644
--- a/tests/fix_pq.py
+++ b/tests/fix_pq.py
@@ -47,19 +47,7 @@ def pytest_runtest_setup(item):
@@ -49,18 +49,7 @@ def pytest_runtest_setup(item):
@pytest.fixture
def libpq():
"""Return a ctypes wrapper to access the libpq."""
Expand All @@ -52,11 +53,7 @@ index 917dfc91..5e360fb3 100644
- pytest.skip(f"can't load libpq for testing: {e}")
- else:
- raise
-
+ return ctypes.cdll.LoadLibrary("@libpq@")


@pytest.fixture
def setpgenv(monkeypatch):
--
2.47.0

0 comments on commit 058bc95

Please sign in to comment.