summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-11-28 03:33:23 +0000
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-11-28 17:19:01 +0000
commit87da2f898def201484772089e904d0053bddc873 (patch)
treed109fd060b9d692f4222770f127c1353f7e8f63d
parent3e52b5445ba1bcf50dc4b0b4357fc9fcfdcc5741 (diff)
downloadpsycopg2-87da2f898def201484772089e904d0053bddc873.tar.gz
Fixed __libpq_version__ for Postgres >= 10.1
The version should be considered as 10.0.1; the number was generated as 10.1.0 instead. Version number bumped to test building new wheels packages. Fix #632.
-rw-r--r--NEWS4
-rw-r--r--setup.py8
2 files changed, 8 insertions, 4 deletions
diff --git a/NEWS b/NEWS
index 7d99ed3..c3e225a 100644
--- a/NEWS
+++ b/NEWS
@@ -13,8 +13,10 @@ What's new in psycopg 2.7.4
^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Fixed Solaris 10 support (:ticket:`#532`).
-- Fixed `MinTimeLoggingCursor` on Python 3 (:ticket:`#609`).
+- Fixed `!MinTimeLoggingCursor` on Python 3 (:ticket:`#609`).
- Fixed parsing of array of points as floats (:ticket:`#613`).
+- Fixed `~psycopg2.__libpq_version__` building with libpq >= 10.1
+ (:ticket:`632`).
What's new in psycopg 2.7.3.2
diff --git a/setup.py b/setup.py
index 264078a..e6144af 100644
--- a/setup.py
+++ b/setup.py
@@ -194,8 +194,7 @@ or with the pg_config option in 'setup.cfg'.
return None
pg_first_inst_key = winreg.OpenKey(reg,
- 'SOFTWARE\\PostgreSQL\\Installations\\'
- + first_sub_key_name)
+ 'SOFTWARE\\PostgreSQL\\Installations\\' + first_sub_key_name)
try:
pg_inst_base_dir = winreg.QueryValueEx(
pg_first_inst_key, 'Base Directory')[0]
@@ -406,11 +405,14 @@ class psycopg_build_ext(build_ext):
m = verre.match(pgversion)
if m:
pgmajor, pgminor, pgpatch = m.group(1, 2, 3)
+ # Postgres >= 10 doesn't have pgminor anymore.
+ pgmajor = int(pgmajor)
+ if pgmajor >= 10:
+ pgminor, pgpatch = None, pgminor
if pgminor is None or not pgminor.isdigit():
pgminor = 0
if pgpatch is None or not pgpatch.isdigit():
pgpatch = 0
- pgmajor = int(pgmajor)
pgminor = int(pgminor)
pgpatch = int(pgpatch)
else: