mirror of
https://github.com/psycopg/psycopg2.git
synced 2024-11-10 19:16:34 +03:00
Add the flag 'lo64' to the version if psycopg supports the lo_*64 api
This commit is contained in:
parent
0205d6ca2e
commit
b2327b0fc7
10
setup.py
10
setup.py
|
@ -423,6 +423,16 @@ class psycopg_build_ext(build_ext):
|
|||
if (pgmajor, pgminor) >= (9, 3):
|
||||
define_macros.append(("HAVE_LO64", "1"))
|
||||
|
||||
# Inject the flag in the version string already packed up
|
||||
# because we didn't know the version before.
|
||||
# With distutils everything is complicated.
|
||||
for i, t in enumerate(define_macros):
|
||||
if t[0] == 'PSYCOPG_VERSION':
|
||||
n = t[1].find(')')
|
||||
if n > 0:
|
||||
define_macros[i] = (
|
||||
t[0], t[1][:n] + ' lo64' + t[1][n:])
|
||||
|
||||
except Warning:
|
||||
w = sys.exc_info()[1] # work around py 2/3 different syntax
|
||||
sys.stderr.write("Error: %s\n" % w)
|
||||
|
|
Loading…
Reference in New Issue
Block a user