@@ -107,8 +107,7 @@ def conn(host=None, user=None, password=None, *, init_fun=None, reset=False, use
107107 #encrypted-connection-options).
108108 """
109109 if not hasattr (conn , 'connection' ) or reset :
110- host_input = host if host is not None else config ['database.host' ]
111- host = get_host_hook (host_input )
110+ host = host if host is not None else config ['database.host' ]
112111 user = user if user is not None else config ['database.user' ]
113112 password = password if password is not None else config ['database.password' ]
114113 if user is None : # pragma: no cover
@@ -117,8 +116,7 @@ def conn(host=None, user=None, password=None, *, init_fun=None, reset=False, use
117116 password = getpass (prompt = "Please enter DataJoint password: " )
118117 init_fun = init_fun if init_fun is not None else config ['connection.init_function' ]
119118 use_tls = use_tls if use_tls is not None else config ['database.use_tls' ]
120- conn .connection = Connection (host , user , password , None , init_fun , use_tls ,
121- host_input = host_input )
119+ conn .connection = Connection (host , user , password , None , init_fun , use_tls )
122120 return conn .connection
123121
124122
@@ -160,8 +158,8 @@ class Connection:
160158 :param use_tls: TLS encryption option
161159 """
162160
163- def __init__ (self , host , user , password , port = None , init_fun = None , use_tls = None ,
164- host_input = None ):
161+ def __init__ (self , host , user , password , port = None , init_fun = None , use_tls = None ):
162+ host_input , host = ( host , get_host_hook ( host ))
165163 if ':' in host :
166164 # the port in the hostname overrides the port argument
167165 host , port = host .split (':' )
0 commit comments