Merge pull request #504 from fogzot/pgversion-fix

Fixed version regexp to match "10devel"
This commit is contained in:
Federico Di Gregorio 2017-02-04 14:32:06 +01:00 committed by GitHub
commit 9448576ba6

View File

@ -417,10 +417,12 @@ class psycopg_build_ext(build_ext):
pgversion = "7.4.0"
verre = re.compile(
r"(\d+)\.(\d+)(?:(?:\.(\d+))|(devel|(alpha|beta|rc)\d+))")
r"(\d+)(?:\.(\d+))?(?:(?:\.(\d+))|(devel|(?:alpha|beta|rc)\d+))?")
m = verre.match(pgversion)
if m:
pgmajor, pgminor, pgpatch = m.group(1, 2, 3)
if pgminor is None or not pgminor.isdigit():
pgminor = 0
if pgpatch is None or not pgpatch.isdigit():
pgpatch = 0
pgmajor = int(pgmajor)