Skip to content

Commit 5d196c5

Browse files
author
Kyle Halog
authored
Fixed versionstring fails
Split of Versionstring fails: db = postgresql.open(database='marten',host='10.8.2.1',port=5431) # postgresql-v10 runs on port 5431 on that machine -> File "/usr/lib/python3/dist-packages/postgresql/versionstring.py", line 28, in <listcomp> vlist = [int(x or '0') for x in v[:-1]] ValueError: invalid literal for int() with base 10: '2 (Debian 10'
1 parent ef7b9a9 commit 5d196c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

postgresql/versionstring.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def split(vstr : str) -> (
1515
Split a PostgreSQL version string into a tuple
1616
(major,minor,patch,...,state_class,state_level)
1717
"""
18-
v = vstr.strip().split('.')
18+
v = vstr.strip().split(' ')[0].split('.')
1919

2020
# Get rid of the numbers around the state_class (beta,a,dev,alpha, etc)
2121
state_class = v[-1].strip('0123456789')

0 commit comments

Comments
 (0)