|
29 | 29 |
|
30 | 30 | import os
|
31 | 31 | import sys
|
32 |
| -import re |
33 | 32 | import subprocess
|
34 | 33 | from setuptools import setup, Extension
|
35 | 34 | from distutils.command.build_ext import build_ext
|
@@ -381,34 +380,8 @@ def finalize_options(self):
|
381 | 380 | if token.startswith("-I"):
|
382 | 381 | self.include_dirs.append(token[2:])
|
383 | 382 |
|
384 |
| - pgversion = pg_config_helper.query("version").split()[1] |
385 |
| - |
386 |
| - verre = re.compile( |
387 |
| - r"(\d+)(?:\.(\d+))?(?:(?:\.(\d+))|(devel|(?:alpha|beta|rc)\d+))?") |
388 |
| - m = verre.match(pgversion) |
389 |
| - if m: |
390 |
| - pgmajor, pgminor, pgpatch = m.group(1, 2, 3) |
391 |
| - # Postgres >= 10 doesn't have pgminor anymore. |
392 |
| - pgmajor = int(pgmajor) |
393 |
| - if pgmajor >= 10: |
394 |
| - pgminor, pgpatch = None, pgminor |
395 |
| - if pgminor is None or not pgminor.isdigit(): |
396 |
| - pgminor = 0 |
397 |
| - if pgpatch is None or not pgpatch.isdigit(): |
398 |
| - pgpatch = 0 |
399 |
| - pgminor = int(pgminor) |
400 |
| - pgpatch = int(pgpatch) |
401 |
| - else: |
402 |
| - sys.stderr.write( |
403 |
| - f"Error: could not determine PostgreSQL version from " |
404 |
| - f"'{pgversion}'") |
405 |
| - sys.exit(1) |
406 |
| - |
407 |
| - define_macros.append(("PG_VERSION_NUM", "%d%02d%02d" % |
408 |
| - (pgmajor, pgminor, pgpatch))) |
409 |
| - |
410 |
| - # enable lo64 if libpq >= 9.3 and Python 64 bits |
411 |
| - if (pgmajor, pgminor) >= (9, 3) and is_py_64(): |
| 383 | + # enable lo64 if Python 64 bits |
| 384 | + if is_py_64(): |
412 | 385 | define_macros.append(("HAVE_LO64", "1"))
|
413 | 386 |
|
414 | 387 | # Inject the flag in the version string already packed up
|
|
0 commit comments