mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
Compatibility with python 3.7.6 (#1368)
The urlparse function has changed.
Old versions:
```python
>>> urlparse('localhost:8500')
ParseResult(scheme='', netloc='', path='localhost:8500', params='', query='', fragment='')
```
3.7.6:
```python
>>> urlparse('localhost:8500')
ParseResult(scheme='localhost', netloc='', path='8500', params='', query='', fragment='')
```
This commit is contained in:
+2
-2
@@ -49,11 +49,11 @@ class PatroniCtlException(ClickException):
|
||||
def parse_dcs(dcs):
|
||||
if dcs is None:
|
||||
return None
|
||||
elif '//' not in dcs:
|
||||
dcs = '//' + dcs
|
||||
|
||||
parsed = urlparse(dcs)
|
||||
scheme = parsed.scheme
|
||||
if scheme == '' and parsed.netloc == '':
|
||||
parsed = urlparse('//' + dcs)
|
||||
port = int(parsed.port) if parsed.port else None
|
||||
|
||||
if scheme == '':
|
||||
|
||||
Reference in New Issue
Block a user