mirror of
https://github.com/psycopg/psycopg2.git
synced 2025-01-31 17:34:08 +03:00
Fixed check for PG version
It would have failed in PostgreSQL 10.0.
This commit is contained in:
parent
e5bbde9554
commit
91eabf5fcb
7
setup.py
7
setup.py
|
@ -407,6 +407,9 @@ class psycopg_build_ext(build_ext):
|
||||||
pgmajor, pgminor, pgpatch = m.group(1, 2, 3)
|
pgmajor, pgminor, pgpatch = m.group(1, 2, 3)
|
||||||
if pgpatch is None or not pgpatch.isdigit():
|
if pgpatch is None or not pgpatch.isdigit():
|
||||||
pgpatch = 0
|
pgpatch = 0
|
||||||
|
pgmajor = int(pgmajor)
|
||||||
|
pgminor = int(pgminor)
|
||||||
|
pgpatch = int(pgpatch)
|
||||||
else:
|
else:
|
||||||
sys.stderr.write(
|
sys.stderr.write(
|
||||||
"Error: could not determine PostgreSQL version from '%s'"
|
"Error: could not determine PostgreSQL version from '%s'"
|
||||||
|
@ -414,10 +417,10 @@ class psycopg_build_ext(build_ext):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
define_macros.append(("PG_VERSION_HEX", "0x%02X%02X%02X" %
|
define_macros.append(("PG_VERSION_HEX", "0x%02X%02X%02X" %
|
||||||
(int(pgmajor), int(pgminor), int(pgpatch))))
|
(pgmajor, pgminor, pgpatch)))
|
||||||
|
|
||||||
# enable lo64 if postgres >= 9.3
|
# enable lo64 if postgres >= 9.3
|
||||||
if int(pgmajor) >= 9 and int(pgminor) >= 3:
|
if (pgmajor, pgminor) >= (9, 3):
|
||||||
define_macros.append(("HAVE_LO64", "1"))
|
define_macros.append(("HAVE_LO64", "1"))
|
||||||
else:
|
else:
|
||||||
define_macros.append(("HAVE_LO64", "0"))
|
define_macros.append(("HAVE_LO64", "0"))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user