Skip to content

Commit fa6150a

Browse files
committed
Setting appropriate defaults
1 parent 99fda86 commit fa6150a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

amqpy/connection.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,9 @@ def __init__(self, host='localhost', port=5672, ssl=None, connect_timeout=None,
123123
if host.startswith('amqp://'):
124124
parts = urlparse("http://" + host[7:])
125125
host = unquote(parts.hostname or '') or None
126-
port = parts.port
127-
userid = unquote(parts.username or '') or None
128-
password = unquote(parts.password or '') or None
126+
port = parts.port or 5672
127+
userid = unquote(parts.username or '') or 'guest'
128+
password = unquote(parts.password or '') or 'guest'
129129
virtual_host = unquote(parts.path or '/')
130130

131131
# save connection parameters

0 commit comments

Comments
 (0)