Skip to content

Commit

Permalink
Reduce line length
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeyklay authored Jan 2, 2022
1 parent 0a508ce commit 6e74baa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions environ/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,16 +505,16 @@ def db_url_config(cls, url, engine=None):
user_host = url.netloc.rsplit('@', 1)
if url.scheme in cls.POSTGRES_FAMILY and ',' in user_host[-1]:
# Parsing postgres cluster dsn
hostinfo = list(
hinfo = list(
itertools.zip_longest(
*(
host.rsplit(':', 1)
for host in user_host[-1].split(',')
)
)
)
hostname = ','.join(hostinfo[0])
port = ','.join(filter(None, hostinfo[1])) if len(hostinfo) == 2 else ''
hostname = ','.join(hinfo[0])
port = ','.join(filter(None, hinfo[1])) if len(hinfo) == 2 else ''
else:
hostname = url.hostname
port = url.port
Expand Down

0 comments on commit 6e74baa

Please sign in to comment.