Skip to content

Commit

Permalink
fix(windows): resolve absolute path to libpq
Browse files Browse the repository at this point in the history
Might solve the problem mentioned in the comments in #912.
  • Loading branch information
kemosh authored and dvarrazzo committed Sep 29, 2024
1 parent 494bd6f commit bea783d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions psycopg/psycopg/pq/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import logging
import ctypes.util
from typing import NamedTuple
from pathlib import Path

from . import abc
from ._enums import ConnStatus, TransactionStatus, PipelineStatus
Expand Down Expand Up @@ -52,6 +53,7 @@ class PGresAttDesc(NamedTuple):
def find_libpq_full_path() -> str | None:
if sys.platform == "win32":
libname = ctypes.util.find_library("libpq.dll")
libname = str(Path(libname).resolve())

elif sys.platform == "darwin":
libname = ctypes.util.find_library("libpq.dylib")
Expand Down

0 comments on commit bea783d

Please sign in to comment.