Skip to content

Commit

Permalink
Fixed version regexp to match "10devel"
Browse files Browse the repository at this point in the history
Also normalized the result and made sure that if PostgreSQL ever starts
using just integer version numbers (as in "10") everything still works.
  • Loading branch information
fogzot committed Feb 4, 2017
1 parent de8b335 commit 8b96bcd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,12 @@ def finalize_options(self):
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)
Expand Down

0 comments on commit 8b96bcd

Please sign in to comment.