Skip to content

Commit ab279cd

Browse files
committed
improve version handling
1 parent 5af8987 commit ab279cd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎testgres/testgres.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -1157,8 +1157,11 @@ def get_pg_config():
11571157
pg_config_data[key.strip()] = value.strip()
11581158

11591159
# Fetch version of PostgreSQL and save it as VERSION_NUM
1160-
version_parts = pg_config_data["VERSION"].split(" ")
1161-
version, _, _ = version_parts[-1].partition('beta')
1160+
version = pg_config_data["VERSION"]
1161+
version = version.split(" ")[-1] \
1162+
.partition('devel')[0] \
1163+
.partition('beta')[0] \
1164+
.partition('rc')[0]
11621165
pg_config_data["VERSION_NUM"] = version
11631166

11641167
return pg_config_data

0 commit comments

Comments
 (0)