Skip to content

Commit 8c344b5

Browse files
author
James William Pye
committed
Don't process fields if they are None.
[Remove a reference to process spec]
1 parent 3eaf4aa commit 8c344b5

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

postgresql/iri.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,22 @@ def construct(x):
8282
'Construct a RI dictionary from a clientparams dictionary'
8383
return (
8484
'pq',
85-
# netloc: user:pass@{host[:port]|process}
85+
# netloc: user:pass@host[:port]
8686
ri.unsplit_netloc((
8787
x.get('user'),
8888
x.get('password'),
8989
'[' + x.get('host') + ']' if (
9090
str(x.get('ipv', -1)) == '6' and ':' in x.get('host', '')
9191
) else x.get('host'),
92-
x.get('port')
92+
None if 'port' not in x else str(x['port'])
9393
)),
94-
None if 'database' not in x else (
94+
None if x.get('database') is None else (
9595
ri.escape_path_re.sub(x['database'], '/')
9696
),
97-
None if 'settings' not in x else (
97+
None if x.get('settings') is None else (
9898
ri.construct_query(x['settings'])
9999
),
100-
None if 'path' not in x else construct_path(x['path']),
100+
None if x.get('path') is None else construct_path(x['path']),
101101
)
102102

103103
def parse(s, fieldproc = ri.unescape):

0 commit comments

Comments
 (0)